Webpack - Critical dependency: the request of a dependency is an expression

前端 未结 3 1235
野趣味
野趣味 2020-12-14 13:44

I am getting three warning messages when importing request in a barebone webpack project. A minimal example to reproduce the bug is available on GitHub (run

相关标签:
3条回答
  • 2020-12-14 14:08

    Solved with npm install request@2.79.0 --save

    According to the authors of ajv, the issue will likely be resolved in the latest version of request in a few weeks' time.

    0 讨论(0)
  • 2020-12-14 14:10

    Replace this

    new webpack.ContextReplacementPlugin(
            /angular(\\|\/)core(\\|\/)@angular/,
            helpers.root('./src'), // location of your src
            {} // a map of your routes
        ),
    

    with this-

    new webpack.ContextReplacementPlugin( /(.+)?angular(\\|\/)core(.+)?/, root('./src'), {} )
    
    0 讨论(0)
  • 2020-12-14 14:33

    This warning can be linked to packages injections in (dependancies or devDependencies).

    If the problem suddenly appears, check the last modification in your package.json.

    Consider removing package-lock.json if you plan to relaunch an npm install.

    0 讨论(0)
提交回复
热议问题