Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

what is Angular compilation warning about System.import() deprecation?

I have updated My angular app to version 7. And there is a warning after compilation on the screen

WARNING in ./node_modules/@angular/core/fesm5/core.js 17182:15-102
System.import() is deprecated and will be removed soon. Use import() instead.
For more info visit https://webpack.js.org/guides/code-splitting/

I got the solution to remove it by putting this code webpack config

// Ignore warnings about System.import in Angular
{ test: /[\/\\]@angular[\/\\].+\.js$/, parser: { system: true } },

Even this got solved. I just want to know what is this issue related with? What is root cause? Do I need to update code as well?

Update

I read this, and this is what I got

add import() as Code Splitting construct. It should be used instead of System.import when possible. System.import will be deprecated in webpack 2 release (removed in webpack 3) as it's behaviour is incorrect according to the spec

So exactly what was the issue?

UPdate 2

I got

Possible system values:

  • default: Consider System.import() as import(). Emit a warning if System.import() is used.
  • true: Consider System.import() as import(). No warning.
  • false: System.import() is not intercepted. Using it most like triggers a TypeError

Comments