Closed Murilo-Perrone closed 6 years ago
Fixed it by adjusting my configuration. Replaced the ts loader plugin by an simple alias:
const customProdConfig = {
resolve: {
//plugins: [new TsConfigPathsPlugin({ /*configFile: "./path/to/tsconfig.json" */ })]
alias: { 'src': path.resolve('src') },
},
};
I guess it doesn't make sense to use this plugin with AOT.
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.
Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [x] 3.x [ ] 4.x
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request
Current behavior: A runtime exception is being thrown when webpack tries to load ionic-angular module:
This exception originates from the auto-generated code below in main.js:
PS: Got the code above after switching the target into es2017 in
tsconfig.json
just to make it readable and better analyze the error.The exception occurs whenever I run my application using any cordova platform (browser/android/ios) plus the
--aot
option (or--prod
). Yetionic serve --aot
works fine, as well as all dev builds.Expected behavior: The exception was thrown after 8 other modules had been successfully loaded and right before my first user module got a chance of being loaded. That makes me think it is a problem with this particular module (ionic-angular).
Steps to reproduce: I use a custom webpack.config.js, which relies in
tsconfig-paths-webpack-plugin
plugin for prod setting:Here are my dependencies in package.json:
Didn't work with latest angular 5 and rxjs 5.5 either. I downgraded because my application became less responsive. I have tried later version of webkack too (3.11 and 4.5), unsuccessfully.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below): Error occuring on MacOs and on Windows. Info from latest tests:Any test suggestions are very welcome.