-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
still seeing ModuleNotFoundError #58
Comments
Just as another verification that this project is up to date, in } else {
/**
* Webpack 5 does not provide node polyfills as it did before.
* Also, it can't tell whether a code will be executed at runtime, so it has to process everything. This branch of the conditional statement will NEVER run in the browser, but Webpack can't know so it breaks builds unless we start providing node polyfills.
*
* As a workaround, we use __non_webpack_require__ to tell Webpack to ignore this, and we define it to globalThis so it works correctly when running in node.
* See https://github.com/webpack/webpack/issues/8826#issuecomment-660594260
*/
globalThis.__non_webpack_require__ = require; The project is created with NextJS |
Adding fallbacks to webpackFinal as in the original issue seems like a workaround. |
Unfortunately, I ran into that issue as well using CRA: devDependencies: "@storybook/addon-actions": "6.4.19",
"@storybook/addon-essentials": "6.4.19",
"@storybook/addon-links": "6.4.19",
"@storybook/builder-webpack5": "^6.4.19",
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/node-logger": "6.4.19",
"@storybook/preset-create-react-app": "4.0.1",
"@storybook/react": "6.4.19",
"msw": "0.38.1",
"msw-storybook-addon": "1.6.0", When I am running
Any idea what could be wrong with my setup? Thank you very much! It's an awesome tool! |
I saw recent issue Webpack 5 Throws ModuleNotFoundError and related PR fix: add webpack5 support
I was led to this issue because following install and setup of msw-storybook-addon I see a similar error on storybook startup,
ModuleNotFoundError: Module not found: Error: Can't resolve 'http'
with the same long sequence ofHowever I have msw-storybook-addon version 1.4.1, according to the PR that should be released. Perhaps the issue here is subtly different?
and from yarn.lock,
The text was updated successfully, but these errors were encountered: