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.

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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:21

github_iconTop GitHub Comments

18reactions
htulibackicommented, Jan 28, 2021

Ok, the solution in my case was to set legacyNodePolyfills option to false.

More info on this feature: https://laravel-mix.com/docs/6.0/legacy-node-polyfills

2reactions
jringeisencommented, Nov 6, 2021

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).

Read more comments on GitHub >

github_iconTop 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 >

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 Hashnode Post

No results found