# Webpack 5 Polyfills Issue in React

**URL:** <https://builder.metamask.io/t/webpack-5-polyfills-issue-in-react/1725>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [March 7, 2023, 1:42am UTC](https://builder.metamask.io/t/webpack-5-polyfills-issue-in-react/1725 "2023-03-07T01:42:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 7, 2023, 1:42am UTC](https://builder.metamask.io/t/webpack-5-polyfills-issue-in-react/1725/1 "2023-03-07T01:42:56Z")

</div>

> **🏛 Content from Web3Auth Community**
> 
> This topic was originally posted by **shahbaz** on 3/7/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

While setting up a new web3 project from scratch, facing multiple issues with webpack 5?

---

<div class="post-metadata">

**Author:** ![shahbaz](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/shahbaz/32/1527_2.png) [@shahbaz](https://builder.metamask.io/u/shahbaz)\
**Post date:** [March 7, 2023, 1:48am UTC](https://builder.metamask.io/t/webpack-5-polyfills-issue-in-react/1725/2 "2023-03-07T01:48:20Z")

</div>

This issue is caused because the `web3.js` and `ethers.js` packages have certain dependencies not present within the browser environment by webpack 5. Hence, you require certain node polyfills to be added to your project while overriding the configurations to enable their usage. When that is done, your project should be able to utilize the `web3.js` and `ethers.js` packages efficiently without any issues.

If you are using the `create-react-app` version \>= 5, you may run into issues building. The problem can be resolved following the instructions below:

- Install `react-app-rewired` and the missing modules into your application

- Create `config-overrides.js` in the root of your project folder with the content:

- Within `package.json`, change the scripts field for start, build, and test. Instead of `react-scripts`, replace it with `react-app-rewired`.

Read more about this on our [documentation page](https://web3auth.io/docs/troubleshooting/webpack-issues).
