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.

Webpack polyfill error

See original GitHub issue
  • Laravel Mix Version: laravel-mix@6.0.18
  • Node Version: v14.15.4
  • NPM Version: 6.14.10
  • OS: macOS Big Sur

Description:

When i’m running yarn run development i get a whole bunch of errors. mainly the following error

“webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.”

See screenshot: Schermafbeelding 2021-05-03 om 12 02 32

What i’ve tried already:

  • added mix.options({ legacyNodePolyfills: true }); to my webpack.mix.js file
  • added mix.webpackConfig({ resolve: { fallback: { process: require("node-libs-browser").process, buffer: require("node-libs-browser").buffer, }, }, })

unfortunately non of them worked…

Someone knows what to do about this?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:18

github_iconTop GitHub Comments

4reactions
goaroundcommented, Dec 9, 2021

From one day to another, I now get 200+ Webpack polyfill errors in one project. Other projects with Laravel Mix work fine. This is really strange…

Edit: I had an import { options } from "laravel-mix"; in my code. That was the issue for me.

1reaction
mlieshoutcommented, Jan 12, 2022

Same issue here. I use the “Auto Import - ES6, TS, JSX, TSX” extension in VScode. It added this line in one of the react jsx files:

import { react } from “laravel-mix”;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 Receiving a Polyfill Error?!?! My JavaScript React ...
Run npm install node-polyfill-webpack-plugin in your terminal`. go to your webpack.config.js and paste this:
Read more >
How to polyfill node core modules in webpack 5 - Alchemy
The main issue with create-react-app and the polyfill error is that create-react-app, by default, hides the webpack config file inside the node- ...
Read more >
Webpack 5 errors | ImmutableX Documentation
The reason for this error is that create-react-app uses a version of webpack greater than 5, which, unlike versions < 5, does not...
Read more >
BREAKING CHANGE: webpack < 5 used to include polyfills ...
I am getting a number of errors like this: BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by...
Read more >
Webpack 5 Issues | Documentation - Web3Auth
This issue is caused due to the fact that the web3.js and ethers.js packages have certain dependencies, which are not present within the...
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