_From @rodrigoreal on April 26, 2017 23:35_
Ionic version: (check one with "x")
[ ] 1.x
[ ] 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:
> ionic run android --prod
> [email protected] ionic:build /Users/rodrigoreal/Projetos/rodrigo/proderror
> ionic-app-scripts build "--prod"
[20:25:56] ionic-app-scripts 1.3.5
[20:25:56] build prod started ...
[20:25:56] clean started ...
[20:25:56] clean finished in 4 ms
[20:25:56] copy started ...
[20:25:56] ngc started ...
[20:26:15] ngc finished in 18.54 s
[20:26:15] preprocess started ...
[20:26:15] deeplinks started ...
[20:26:15] deeplinks finished in 165 ms
[20:26:15] optimization started ...
[20:26:15] copy finished in 18.95 s
[20:26:19] ionic-app-script task: "build"
[20:26:19] Error: ./src/pages/home/home.module.ngfactory.ts Module parse failed:
/Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js!/Users/rodrigoreal/Projetos/rodrigo/proderror/src/pages/home/home.module.ngfactory.ts
Unexpected token (26:58) You may need an appropriate loader to handle this file type. | import * as import15
from './home'; | import * as import16 from 'ionic-angular/util/module-loader'; | class HomeModuleInjector
extends import0.ɵNgModuleInjector<import1.HomeModule> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @ ./src/app/main.ts,./src/pages/tabs/tabs.module.ngfactory.ts Module parse
failed:
/Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js!/Users/rodrigoreal/Projetos/rodrigo/proderror/src/pages/tabs/tabs.module.ngfactory.ts
Unexpected token (26:58) You may need an appropriate loader to handle this file type. | import * as import15
from './tabs'; | import * as import16 from 'ionic-angular/util/module-loader'; | class TabsModuleInjector
extends import0.ɵNgModuleInjector<import1.TabsModule> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @ ./src/app/main.ts
Error: ./src/pages/home/home.module.ngfactory.ts
Module parse failed: /Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js!/Users/rodrigoreal/Projetos/rodrigo/proderror/src/pages/home/home.module.ngfactory.ts Unexpected token (26:58)
You may need an appropriate loader to handle this file type.
| import * as import15 from './home';
| import * as import16 from 'ionic-angular/util/module-loader';
| class HomeModuleInjector extends import0.ɵNgModuleInjector<import1.HomeModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/tabs/tabs.module.ngfactory.ts
Module parse failed: /Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/webpack/optimization-loader.js!/Users/rodrigoreal/Projetos/rodrigo/proderror/src/pages/tabs/tabs.module.ngfactory.ts Unexpected token (26:58)
You may need an appropriate loader to handle this file type.
| import * as import15 from './tabs';
| import * as import16 from 'ionic-angular/util/module-loader';
| class TabsModuleInjector extends import0.ɵNgModuleInjector<import1.TabsModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (/Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/rodrigoreal/Projetos/rodrigo/proderror/node_modules/@ionic/app-scripts/dist/preprocess.js:18:21
at process._tickCallback (internal/process/next_tick.js:103:7)
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node@6/6.9.5/bin/node" "/usr/local/bin/npm" "run" "ionic:build" "--" "--prod"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] ionic:build: `ionic-app-scripts build "--prod"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] ionic:build script 'ionic-app-scripts build "--prod"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build "--prod"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/rodrigoreal/Projetos/rodrigo/proderror/npm-debug.log
Expected behavior:
Build the app
Steps to reproduce:
ionic start tabs tabs --v2
Delete all the pages and their imports on app.module
Create the home and tabs page with lazyloading
ionic run android --prod
I created a repo to reproduce that:
https://github.com/rodrigoreal/ionic-prod-error
Other information:
Ionic serve and Ionic run android without the prod flag work.
Ionic info:
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.1.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.5
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.9.5
Xcode version: Xcode 8.3.2 Build version 8E2002
_Copied from original issue: driftyco/ionic#11388_
_From @rapropos on April 27, 2017 0:8_
I suspect the problem lies somewhere in src/pages/tabs/tabs.module.ts.
_From @rodrigoreal on April 27, 2017 0:44_
@rapropos i don't think so, i just removed the tabs page, and now i only have the home and it is still happening.
_From @zeekox on April 27, 2017 1:1_
Had the same problem, it is caused by @ionic/app-scripts version > 1.1.4, downgrading to 1.1.4 solve the problem.
_From @rodrigoreal on April 27, 2017 1:8_
Thanks for the downgrading idea, i just downgrade from 1.3.5 to 1.3.4 and it is working now.
_From @danielehrhardt on April 27, 2017 3:14_
Same Problem here
can you please reopen the issue?
This also happens with one lazy loading page
[18:04:28] ionic-app-script task: "build"
[18:04:28] Error: ./src/pages/home/home.module.ngfactory.ts Module parse failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\home\home.module.ngfacto
ry.ts
Unexpected token (26:58) You may need an appropriate loader to handle this file type. | import * as import
15
from './home'; | import * as import16 from 'ionic-angular/util/module-loader'; | class HomeModuleInjector
extends import0.ɵNgModuleInjector<import1.HomeModule> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @ ./src/app/main.ts,./src/pages/jzl/jzl.module.ngfactory.ts Module parse
failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl\jzl.module.ngfactory
.ts
Unexpected token (27:57) You may need an appropriate loader to handle this file type. | import * as import
16
from './jzl'; | import * as import17 from 'ionic-angular/util/module-loader'; | class JzlModuleInjector
extends import0.ɵNgModuleInjector<import1.JzlModule> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @
./src/app/main.ts,./src/pages/jzl/jzl-entry-view/jzl-entry-view.module.ngfactory.ts Module parse failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl\jzl-entry-view\jzl-e
ntry-view.module.ngfactory.ts
Unexpected token (26:66) You may need an appropriate loader to handle this file type. | import * as import
15
from './jzl-entry-view'; | import * as import16 from 'ionic-angular/util/module-loader'; | class
JzlEntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.JzlEntryViewModule> { |
_CommonModule_0:import2.CommonModule; | _ɵba_1:import3.ɵba; @ ./src async @
./~/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @
./src/app/main.ts,./src/pages/jzl1/jzl1.module.ngfactory.ts Module parse failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl1\jzl1.module.ngfacto
ry.ts
Unexpected token (27:58) You may need an appropriate loader to handle this file type. | import * as import
16
from './jzl1'; | import * as import17 from 'ionic-angular/util/module-loader'; | class Jzl1ModuleInjector
extends import0.ɵNgModuleInjector<import1.Jzl1Module> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @
./src/app/main.ts,./src/pages/jzl1/jzl1-entry-view/jzl1-entry-view.module.ngfactory.ts Module parse failed
:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl1\jzl1-entry-view\jzl
1-entry-view.module.ngfactory.ts
Unexpected token (26:67) You may need an appropriate loader to handle this file type. | import * as import
15
from './jzl1-entry-view'; | import * as import16 from 'ionic-angular/util/module-loader'; | class
Jzl1EntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.Jzl1EntryViewModule> { |
_CommonModule_0:import2.CommonModule; | _ɵba_1:import3.ɵba; @ ./src async @
./~/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @
./src/app/main.ts,./src/pages/pcl/pcl.module.ngfactory.ts Module parse failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\pcl\pcl.module.ngfactory
.ts
Unexpected token (27:57) You may need an appropriate loader to handle this file type. | import * as import
16
from './pcl'; | import * as import17 from 'ionic-angular/util/module-loader'; | class PclModuleInjector
extends import0.ɵNgModuleInjector<import1.PclModule> { | _CommonModule_0:import2.CommonModule; |
_ɵba_1:import3.ɵba; @ ./src async @ ./~/ionic-angular/util/ng-module-loader.js @
./src/app/app.module.ngfactory.js @
./src/app/main.ts,./src/pages/pcl/pcl-entry-view/pcl-entry-view.module.ngfactory.ts Module parse failed:
E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\webpack\
optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\pcl\pcl-entry-view\pcl-e
ntry-view.module.ngfactory.ts
Unexpected token (26:66) You may need an appropriate loader to handle this file type. | import * as import
15
from './pcl-entry-view'; | import * as import16 from 'ionic-angular/util/module-loader'; | class
PclEntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.PclEntryViewModule> { |
_CommonModule_0:import2.CommonModule; | _ɵba_1:import3.ɵba; @ ./src async @
./~/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ ./src/app/main.ts
Error: ./src/pages/home/home.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\home\home.modul
e.ngfactory.ts Unexpected token (26:58)
You may need an appropriate loader to handle this file type.
| import * as import15 from './home';
| import * as import16 from 'ionic-angular/util/module-loader';
| class HomeModuleInjector extends import0.ɵNgModuleInjector<import1.HomeModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/jzl/jzl.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl\jzl.module.
ngfactory.ts Unexpected token (27:57)
You may need an appropriate loader to handle this file type.
| import * as import16 from './jzl';
| import * as import17 from 'ionic-angular/util/module-loader';
| class JzlModuleInjector extends import0.ɵNgModuleInjector<import1.JzlModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/jzl/jzl-entry-view/jzl-entry-view.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl\jzl-entry-v
iew\jzl-entry-view.module.ngfactory.ts Unexpected token (26:66)
You may need an appropriate loader to handle this file type.
| import * as import15 from './jzl-entry-view';
| import * as import16 from 'ionic-angular/util/module-loader';
| class JzlEntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.JzlEntryViewModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/jzl1/jzl1.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl1\jzl1.modul
e.ngfactory.ts Unexpected token (27:58)
You may need an appropriate loader to handle this file type.
| import * as import16 from './jzl1';
| import * as import17 from 'ionic-angular/util/module-loader';
| class Jzl1ModuleInjector extends import0.ɵNgModuleInjector<import1.Jzl1Module> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/jzl1/jzl1-entry-view/jzl1-entry-view.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\jzl1\jzl1-entry
-view\jzl1-entry-view.module.ngfactory.ts Unexpected token (26:67)
You may need an appropriate loader to handle this file type.
| import * as import15 from './jzl1-entry-view';
| import * as import16 from 'ionic-angular/util/module-loader';
| class Jzl1EntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.Jzl1EntryViewModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/pcl/pcl.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\pcl\pcl.module.
ngfactory.ts Unexpected token (27:57)
You may need an appropriate loader to handle this file type.
| import * as import16 from './pcl';
| import * as import17 from 'ionic-angular/util/module-loader';
| class PclModuleInjector extends import0.ɵNgModuleInjector<import1.PclModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/pcl/pcl-entry-view/pcl-entry-view.module.ngfactory.ts
Module parse failed: E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist
\webpack\optimization-loader.js!E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\src\pages\pcl\pcl-entry-v
iew\pcl-entry-view.module.ngfactory.ts Unexpected token (26:66)
You may need an appropriate loader to handle this file type.
| import * as import15 from './pcl-entry-view';
| import * as import16 from 'ionic-angular/util/module-loader';
| class PclEntryViewModuleInjector extends import0.ɵNgModuleInjector<import1.PclEntryViewModule> {
| _CommonModule_0:import2.CommonModule;
| _ɵba_1:import3.ɵba;
@ ./src async
@ ./~/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\di
st\util\errors.js:16:28)
at E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\node_modules\@ionic\app-scripts\dist\preprocess.js
:18:21
at process._tickCallback (internal/process/next_tick.js:103:7)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "r
un" "ionic:build" "--" "--prod"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] ionic:build: `ionic-app-scripts build "--prod"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] ionic:build script 'ionic-app-scripts build "--prod"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build "--prod"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\BussmannIT\Projekte\EC-Zeltlager\ec-zeltlager-mitarbeiter\npm-debug.log
I'm on the same boat, can't run --prod on ionic 3 either.
This should be fixed in 1.3.6. npm install @ionic/app-scripts@latest
Thanks,
Dan
@danbucholtz Thank you!! :)
I have the same Issue
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.6
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.7.4
Xcode version: Xcode 8.3 Build version 8E162
This problem and this other when run android
main.js:110393 Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
Confirmed the latest scripts fix this for me.
@danbucholtz
The latest scripts still give me the error and the same as downgrading to 1.1.4 unsure what to do...
@g1bbzy, did you reinstalled the ionic to latest beta?
npm uninstall -g ionic
npm install -g ionic@canary
Remove node_modules folder in your project.
After that if ionic will ask to run more npm commands, do it.
If still issue post here your ionic info and package.json, version of npm and models.
May be reinstalling node would also help.
updating to 1.3.6 worked for me.. Thanks
Most helpful comment
This should be fixed in
1.3.6.npm install @ionic/app-scripts@latestThanks,
Dan