NgModuleLoader not Webpack-friendly

Ionic version: (check one with “x”)
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x

I’m submitting a … (check one with “x”)
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
When trying to build a Angular app using ionic-angular without the Ionic CLI but with webpack (using angular-cli for example), this warnings appear during build:

WARNING in ./~/ionic-angular/util/ng-module-loader.js
54:11-36 Critical dependency: the request of a dependency is an expression

WARNING in ./~/ionic-angular/util/ng-module-loader.js
69:11-36 Critical dependency: the request of a dependency is an expression

These are due to the dynamic System.import() making Webpack unable to alias properly the files to import statically.

Expected behavior:
It should build without warnings.

Steps to reproduce:
Create a new project with angular-cli, then npm install -S ionic-angular and include ionic-angular modules in app.module.ts.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

[WARN] You are not in an Ionic project directory. Project context may be missing.

global packages:

    @ionic/cli-plugin-proxy : 1.3.1
    @ionic/cli-utils        : 1.4.0
    Ionic CLI               : 3.4.0

System:

    Node       : v7.9.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.2.1 Build version 8C1002 
    ios-deploy : 1.9.0 
    ios-sim    : 5.0.4 
    npm        : 4.2.0 

Author: Fantashit

1 thought on “NgModuleLoader not Webpack-friendly

  1. Hello! Thanks for opening an issue with us! As this seems like more of a support question I will urge that you ask this question on our forum or on our slack channel. Thanks for using Ionic!

Comments are closed.