Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Solved with npm install [email protected] --save

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


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'), {} )

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.


I got this in Angular when I imported EventEmitter from 'protractor' by accident. I blame my IDE for even suggesting it!

It should be imported from core:

import { EventEmitter } from '@angular/core';