Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NgModuleLoader not Webpack-friendly #12285

Closed
sinedied opened this issue Jul 7, 2017 · 7 comments
Closed

NgModuleLoader not Webpack-friendly #12285

sinedied opened this issue Jul 7, 2017 · 7 comments

Comments

@sinedied
Copy link

sinedied commented Jul 7, 2017

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 
@jgw96
Copy link
Contributor

jgw96 commented Jul 7, 2017

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!

@jgw96 jgw96 closed this as completed Jul 7, 2017
@sinedied
Copy link
Author

sinedied commented Jul 7, 2017

@jgw96 This is not a support question but indeed a bug report.
According to the source of the issue (ie webpack): webpack/webpack#196 which explains why this warning is emitted, there is no other way to fix this warning other than fixing the library causing this.

@sinedied
Copy link
Author

After investigation and according to the docs, this can be resolved with require context.

@jgw96 Are you open to a PR on this?

@sharanainapurapu
Copy link

sharanainapurapu commented Dec 21, 2017

@sinedied I am facing same issue. Can you please explain what you did to fix the issue in detail what you mean by "resolved with require context"

@sinedied
Copy link
Author

I did not fix the issue and went with the (harmless) warning since I want to keep a vanilla angular-cli setup. However if you eject your webpack configuration, you can either ignore it or use a require context setup to silence the warning.

@FazioNico
Copy link

Same issu.. hope @ionic-team will fix it soon as possible to realy enable Ionic UI on a simple standard Angular CLI project.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants