Error: Can't resolve 'process/browser' in exifr
See original GitHub issue- Laravel Mix Version: 6.0.4 (
npm list --depth=0
) - Node Version (
node -v
): 14.15.3 - NPM Version (
npm -v
): 1.22.10 (yarn) - OS: Mac
Description:
I re-installed my node_modules today and the installed version of Mix was resolved to 6.0.6
. With this dependency change, Laravel Mix starts failing with the following error:
ERROR in ./node_modules/exifr/dist/full.esm.mjs 1:293-300
Module not found: Error: Can't resolve 'process/browser' in '/Users/Kether/Trendspek/trendspek/node_modules/exifr/dist'
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.
webpack compiled with 1 error
error Command failed with exit code 1.
I am able to run my repo successfully from 6.0.0 -> 6.0.3, but it starts throwing this error as soon as I move to 6.0.4 (although the process never exits).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:21
Top Results From Across the Web
node.js - Webpack 5 Breaking Changes "process/browser"
I added 'process/browser': require. resolve('process/browser') to the fallbacks object without changing anything else and it worked.
Read more >Error: Can't resolve 'process/browser' in exifr - Bountysource
Error : Can't resolve 'process/browser' in exifr.
Read more >exifr - npm
Start using exifr in your project by running `npm i exifr`. ... Of course, you can use the full version in browser, or...
Read more >next js can't resolve 'fs' - You.com | The Search Engine You Control
As @juliomalves pointed out, @elastic/elasticsearch has no support for browser environments. The solution to the problem is to create a separate server that ......
Read more >ES modules via NPM build error "Can't resolve 'pro...
ES modules via NPM build error "Can't resolve 'process/browser'". 2894. 4. 02-22-2021 08:22 PM. ENGEOGIS1. by ENGEOGIS1. New Contributor.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, the solution in my case was to set
legacyNodePolyfills
option tofalse
.More info on this feature: https://laravel-mix.com/docs/6.0/legacy-node-polyfills
Anyone else having issues with this on the M1 Macbook Pro? I have identical environments setup on my iMac (Intel) and my Macbook (M1) but when I do this on my M1 Macbook it breaks my code. But works fine on my iMac (Intel).