You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two groups of issues with the Storybook build:
1. A "Module not found" warning related to the "os" node module.
2. A pair of "ENOTDIR" errors related to `bridgetApi.ts` and
`logging.ts`.
The first is caused by `clean-css`, which attempts to import the "os"
module that's built into Node.js. Storybook's Webpack is building for
the browser so this module is not available, and it's not automatically
polyfilled as of Webpack 5. The "os" module is not required for our
usage of `clean-css`, so the solution is to instruct Webpack to provide
an empty module via `resolve.fallback`.
The second issue is caused by our attempt to mock the `logging.ts` and
`bridgetApi.ts` modules in Storybook. Webpack is attempting to treat
these as directories during the compilation process, which causes the
above error. Removing the `.ts` file extensions solves this. This change
also adds a `$` suffix to these paths, which makes sure an exact match
is always used.
0 commit comments