question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve 'process/browser'

See original GitHub issue

Hi

Firstly, Thank for your work.

I use webpack 5.1 and canvg 3.0.9 Today when complie I get this error log

ERROR in ./node_modules/canvg/lib/index.es.js 1933:16-23
Module not found: Error: Can't resolve 'process/browser' in '*****\node_modules\canvg\lib'       
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.

Have any idea thank!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
robsilvacommented, May 1, 2022

For those in the same boat, I was able to solved it by adding a new rule to webpack (version 5):

modules: {
  rules: [
    {
        test: /\.m?js$/,
        resolve: {
          fullySpecified: false,
        },
      },
      ...
  ]
}
0reactions
Rennix09commented, Jul 22, 2022

For those in the same boat, I was able to solved it by adding a new rule to webpack (version 5):

modules: {
  rules: [
    {
        test: /\.m?js$/,
        resolve: {
          fullySpecified: false,
        },
      },
      ...
  ]
}

save my day, thanks very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Can't resolve 'process/browser' #365 - GitHub
When using 3.1.19 I'm getting the following error: ERROR Failed to compile with 1 errors 11:17:18 error in .
Read more >
Webpack 5 - Uncaught ReferenceError: process is not defined
In webpack 5 automatic node.js polyfills are removed. In the migration docs it is mention that. Try to use frontend-compatible modules ...
Read more >
ES modules via NPM build error "Can't resolve 'pro...
When we remove line 5: "process: "process/browser", we can build but then we have other CORB issues. Everything is working fine when we...
Read more >
r/npm - "Can't resolve 'process/browser.js'" error when running ...
"Can't resolve 'process/browser.js'" error when running npm run prod. r/npm - "Can't resolve 'process/browser.js'.
Read more >
react webpack < 5 used to include polyfills for node.js core ...
react-scripts 5 webpack Module not found: Error: Can't resolve 'fs' ... { "process": require.resolve("process/browser") }' - install 'process' If you don't ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found