最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is the error m

programmeradmin3浏览0评论

I'm getting this error In Create React app, and can't resolve it.

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: { "zlib": require.resolve("browserify-zlib") }'
        - install 'browserify-zlib'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "zlib": false }

And there are 8 vulnerabilities (2 moderate, 6 high)

If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "zlib": false }
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "stream": false }
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "querystring": false }

So changed webpack.config.js to

module.exports = {

  resolve: {
    fallback: {
      path: false, // Ignore the 'path' module
      zlib: false,
      stream:false,
      querystring:false,
      crypto:false,
    },
  },
};

This wont works and npm audit gives

# npm audit report

nth-check  <2.0.1
Severity: high
Inefficient Regular Expression Complexity in nth-check - 
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/svgo/node_modules/nth-check
  css-select  <=3.1.0
  Depends on vulnerable versions of nth-check
  node_modules/svgo/node_modules/css-select
    svgo  1.0.0 - 1.3.2
    Depends on vulnerable versions of css-select
    node_modules/svgo
      @svgr/plugin-svgo  <=5.5.0
      Depends on vulnerable versions of svgo
      node_modules/@svgr/plugin-svgo
        @svgr/webpack  4.0.0 - 5.5.0
        Depends on vulnerable versions of @svgr/plugin-svgo
        node_modules/@svgr/webpack
          react-scripts  >=2.1.4
          Depends on vulnerable versions of @svgr/webpack
          Depends on vulnerable versions of resolve-url-loader
          node_modules/react-scripts

postcss  <8.4.31
Severity: moderate
PostCSS line return parsing error - 
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/resolve-url-loader/node_modules/postcss
  resolve-url-loader  0.0.1-experiment-postcss || 3.0.0-alpha.1 - 4.0.0
  Depends on vulnerable versions of postcss
  node_modules/resolve-url-loader

8 vulnerabilities (2 moderate, 6 high)

Please help me to solve this issue

I want to resolve this issue, there is error message on my screen while npm start I don't know why it's happening, Please help me to resolve it.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论