Skip to content
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

Webpack breaking change: The extension in the request is mandatory #37

Open
zraly opened this issue Jan 27, 2021 · 8 comments
Open

Webpack breaking change: The extension in the request is mandatory #37

zraly opened this issue Jan 27, 2021 · 8 comments
Labels

Comments

@zraly
Copy link

zraly commented Jan 27, 2021

Hi,

when compiling with Webpack(Laravel Mix 6.14.11), I am getting this error:

ERROR in ./node_modules/event-target-shim/index.mjs 62:24-31
Module not found: Error: Can't resolve 'process/browser' in '/Users/medhi/Sites/forma/node_modules/event-target-shim'
Did you mean 'browser.js'?
BREAKING CHANGE: The request 'process/browser' failed to resolve only because it was resolved as fully specified
(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

process: "process/browser",

@mysticatea
Copy link
Owner

Hmm. This package doesn't depend on process/browser in production builds. I suspect that your webpack.config.js has a problem.

@zraly
Copy link
Author

zraly commented Feb 2, 2021

I solved it using

mix.options({
	legacyNodePolyfills: false
});

@xptodevx
Copy link

xptodevx commented Aug 6, 2021

its happening and I can't found a solution yet. this is very hard and deceptive.

@xic911appasaheblakade
Copy link

where write?

@justnewbee
Copy link

there was no rule for mjs files in my webpack config, so i added this in module.rules

  {
      test: /\.mjs$/,
      include: /node_modules/,
      type: 'javascript/auto',
      resolve: {
        fullySpecified: false
      }
    }

and it worked

image

i saw this solution here https://issuehunt.io/r/storybookjs/storybook/issues/14938

@bhavyarustgi-zomato
Copy link

Thankyou so much but any idea why is this happening?

@FacuBozzi
Copy link

there was no rule for mjs files in my webpack config, so i added this in module.rules

  {
      test: /\.mjs$/,
      include: /node_modules/,
      type: 'javascript/auto',
      resolve: {
        fullySpecified: false
      }
    }

and it worked

image

i saw this solution here https://issuehunt.io/r/storybookjs/storybook/issues/14938

How do you even come up with a solution like this? Genuinely asking lol

@premkumarsevugan
Copy link

premkumarsevugan commented Oct 17, 2023

I solved it using

mix.options({
	legacyNodePolyfills: false
});

Thank God. I struggled a lot with this error. Thank you man ❤️.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants