Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 594 Bytes

add-polyfill-modules-for-webpack.md

File metadata and controls

21 lines (13 loc) · 594 Bytes

Add Polyfill Modules For Webpack

Category: React

Prior to webpack version 5, Nodejs polyfills were included by default.

If you see the following error when starting a React project which uses webpack version 5 or higher, you may need to manually add dependencies to your project.

Module not found: Error: Can't resolve 'url' in [...]

BREAKING CHANGE: webpack<5 used to include polyfills for node.js core modules by default.

Add the missing module (for example, url):

yarn add url

Other modules that may need to be added include assert and buffer.