Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEB PACK 5 WARNING #354

Open
ipodjms opened this issue Jun 1, 2021 · 3 comments
Open

WEB PACK 5 WARNING #354

ipodjms opened this issue Jun 1, 2021 · 3 comments

Comments

@ipodjms
Copy link

ipodjms commented Jun 1, 2021

Helo.

After update my angular to 11 to 12, the build console input this warging:

BREAKING CHANGE: 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.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }

where i include it? resolve.fallback: { "crypto": false } ??

@hqs5678
Copy link

hqs5678 commented Jun 10, 2021

解决方法:

  1. 使用4.0 以下版本

  2. 网上的方法, 大多都是这么说的, 但是对我的项目无效, 可能对你的项目有效, 可以一试
    在package.json 中, 在与devDependencies 同级 修改:

    "devDependencies": {
    ...
    },
    "browser": {
    "crypto": false
    }

@evanvosberg
Copy link
Member

Should be fixed in 4.1.1

@christophercr
Copy link

@ipodjms AFAICT part of the issue with Webpack is indeed this library, so upgrading to v4.1.1 will definitely help.

But another part involved in my case was web3 library which also caused the compilation to fail due to the same error. For that I had to follow the steps described here to be able to compile/serve my app: https://github.com/ChainSafe/web3.js#web3-and-angular

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants