Help us test Webpack support in Ionic 2 App Scripts!

Ah, the .js files in my folders were caused by a symbolic link that I had for fixing another problem. After removing this symlink, the .js files are not created inside src anymore.

Now it runs very fast and smoothly, thank you for the great work!

However, the problem that ionic run android hangs at “build dev finished” persists (using “–dev” flag because I’m using typescript@next), whereas ionic serve works without problems. Do you have any ideas what could cause this?

I tried the webpack support beta 2 as per the above instruction. and got the following problems with " ionic serve -l -s -c"
I am fine with beta 1

wjz@bj:~/ion/vajra$ npm install @ionic/app-scripts@beta --save-dev
vajra@ /home/wjz/ion/vajra
└── @ionic/app-scripts@0.0.37-5 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
wjz@bj:~/ion/vajra$ ionic serve -l -s -c 

Running 'serve:before' npm script before serve
> vajra@ watch /home/wjz/ion/vajra
> ionic-app-scripts watch
[09:57:06]  ionic-app-scripts 0.0.37-5 
[09:57:06]  watch started ... 
[09:57:06]  build dev started ... 
[09:57:06]  clean started ... 
[09:57:06]  clean finished in 13 ms 
[09:57:06]  copy started ... 
[09:57:06]  transpile started ... 
[09:57:06]  lint started ... 
[09:57:13]  lint finished in 6.90 s 
[09:57:15]  transpile finished in 8.74 s 
[09:57:15]  webpack started ... 
[09:57:15]  copy finished in 9.38 s 
[09:57:28]  webpack finished in 13.65 s 
[09:57:28]  sass started ... 
[09:57:32]  sass finished in 3.65 s 
[09:57:32]  build dev finished in 26.08 s 
[09:57:32]  watch failed: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 

            /home/wjz/ion/vajra/src/pages/message/message.ts ENOSPC 
[09:57:32]  ionic-app-script task: "watch" 
[09:57:32]  Error: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 
            /home/wjz/ion/vajra/src/pages/message/message.ts ENOSPC 



npm
 ERR! Linux 4.4.0-45-generic
npm ERR! argv "/home/wjz/.nvm/versions/node/v4.5.0/bin/node" "/home/wjz/.nvm/versions/node/v4.5.0/bin/npm" "run" "watch"
npm ERR! node v4.5.0
npm ERR! npm  v3.10.8
npm ERR! 
code ELIFECYCLE
npm ERR! vajra@ watch: `ionic-app-scripts watch`
npm ERR! Exit status 1

npm ERR!
 
npm ERR! Failed at the vajra@ watch script 'ionic-app-scripts watch'.
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 vajra package,
npm ERR!
 not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts watch
npm ERR! You can get information on how to open an issue for this project with:
npm
 ERR!     npm bugs vajra
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vajra
npm ERR! There is likely additional logging output above.



npm ERR! Please include the following file with any support request:
npm ERR!     /home/wjz/ion/vajra/npm-debug.log

Caught exception:
 undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

wjz@bj:~/ion/vajra$ ionic serve -l -s -c 

Running 'serve:before' npm script before serve
> vajra@ watch /home/wjz/ion/vajra
> ionic-app-scripts watch
[09:58:42]  ionic-app-scripts 0.0.37-5 
[09:58:42]  watch started ... 
[09:58:42]  build dev started ... 
[09:58:42]  clean started ... 
[09:58:42]  clean finished in 6 ms 
[09:58:42]  copy started ... 
[09:58:42]  transpile started ... 
[09:58:42]  lint started ... 
[09:58:47]  lint finished in 5.14 s 
[09:58:50]  transpile finished in 7.76 s 
[09:58:50]  webpack started ... 
[09:58:50]  copy finished in 8.09 s 
[09:59:01]  webpack finished in 11.65 s 
[09:59:01]  sass started ... 
[09:59:05]  sass finished in 4.00 s 
[09:59:05]  build dev finished in 23.45 s 
[09:59:06]  watch failed: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 

            /home/wjz/ion/vajra/src/pages/general/general.ts ENOSPC 
[09:59:06]  ionic-app-script task: "watch" 
[09:59:06]  Error: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 
            /home/wjz/ion/vajra/src/pages/general/general.ts ENOSPC 



npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/home/wjz/.nvm/versions/node/v4.5.0/bin/node" "/home/wjz/.nvm/versions/node/v4.5.0/bin/npm" "run" "watch"
npm ERR! node v4.5.0
npm ERR! npm 
 v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! vajra@ watch: `ionic-app-scripts watch`
npm ERR! Exit status 1
npm ERR! 
npm
 ERR! Failed at the vajra@ watch script 'ionic-app-scripts watch'.
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 vajra package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vajra
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vajra
npm ERR! There is likely additional logging output above.



npm ERR! Please include the following file with any support request:
npm ERR!
     /home/wjz/ion/vajra/npm-debug.log

Caught exception:
 undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

wjz@bj:~/ion/vajra$

I restored to beta 1 and do it again strictly as per the upgrade instruction

and got the following problems

wjz@bj:~/ion/vajra$ npm install @ionic/app-scripts@beta
vajra@ /home/wjz/ion/vajra
└── @ionic/app-scripts@0.0.37-5  invalid

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
wjz@bj:~/ion/vajra$ ionic serve -l -s -c 

Running 'serve:before' npm script before serve
> vajra@ watch /home/wjz/ion/vajra
> ionic-app-scripts watch
[10:19:16]  ionic-app-scripts 0.0.37-5 
[10:19:16]  watch started ... 
[10:19:16]  build dev started ... 
[10:19:16]  clean started ... 
[10:19:16]  clean finished in 5 ms 
[10:19:16]  copy started ... 
[10:19:16]  transpile started ... 
[10:19:16]  lint started ... 
[10:19:24]  lint finished in 7.26 s 
[10:19:25]  transpile finished in 9.56 s 
[10:19:25]  webpack started ... 
[10:19:26]  copy finished in 10.46 s 
[10:19:43]  webpack finished in 17.50 s 
[10:19:43]  sass started ... 
[10:20:06]  sass finished in 22.94 s 
[10:20:06]  build dev finished in 50.02 s 
[10:20:06]  watch failed: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 

            /home/wjz/ion/vajra/src ENOSPC 
[10:20:06]  ionic-app-script task: "watch" 
[10:20:06]  Error: watcher error: /home/wjz/ion/vajra/home/wjz/ion/vajra/src/**/*.ts: Error: watch 
            /home/wjz/ion/vajra/src ENOSPC 



npm
 ERR! Linux 4.4.0-45-generic
npm ERR! argv "/home/wjz/.nvm/versions/node/v4.5.0/bin/node" "/home/wjz/.nvm/versions/node/v4.5.0/bin/npm" "run" "watch"
npm ERR! node v4.5.0
npm ERR! 
npm  v3.10.8
npm ERR! code ELIFECYCLE
npm
 ERR! vajra@ watch: `ionic-app-scripts watch`
npm ERR! Exit status 1

npm ERR! 
npm ERR!
 Failed at the vajra@ watch script 'ionic-app-scripts watch'.
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 vajra package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:

npm ERR!     ionic-app-scripts watch
npm ERR! You can get information on how to open an issue for this project with:
npm 
ERR!     npm bugs vajra
npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls vajra
npm 
ERR! There is likely additional logging output above.



npm ERR! Please include the following file with any support request:
npm ERR!
     /home/wjz/ion/vajra/npm-debug.log

Caught exception:
 undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

wjz@bj:~/ion/vajra$ 

I am able to paste the “npm-debug.log” as bellow this time

0 info it worked if it ends with ok
1 verbose cli [ '/home/wjz/.nvm/versions/node/v4.5.0/bin/node',
1 verbose cli   '/home/wjz/.nvm/versions/node/v4.5.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using npm@3.10.8
3 info using node@v4.5.0
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle vajra@~prewatch: vajra@
6 silly lifecycle vajra@~prewatch: no script for prewatch, continuing
7 info lifecycle vajra@~watch: vajra@
8 verbose lifecycle vajra@~watch: unsafe-perm in lifecycle true
9 verbose lifecycle vajra@~watch: PATH: /home/wjz/.nvm/versions/node/v4.5.0/lib/node_modules/npm/bin/node-gyp-bin:/home/wjz/ion/vajra/node_modules/.bin:/home/wjz/.nvm/versions/node/v4.5.0/bin:/home/wjz/bin:/home/wjz/.local/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle vajra@~watch: CWD: /home/wjz/ion/vajra
11 silly lifecycle vajra@~watch: Args: [ '-c', 'ionic-app-scripts watch' ]
12 silly lifecycle vajra@~watch: Returned: code: 1  signal: null
13 info lifecycle vajra@~watch: Failed to exec watch script
14 verbose stack Error: vajra@ watch: `ionic-app-scripts watch`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/home/wjz/.nvm/versions/node/v4.5.0/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/home/wjz/.nvm/versions/node/v4.5.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:829:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid vajra@
16 verbose cwd /home/wjz/ion/vajra
17 error Linux 4.4.0-45-generic
18 error argv "/home/wjz/.nvm/versions/node/v4.5.0/bin/node" "/home/wjz/.nvm/versions/node/v4.5.0/bin/npm" "run" "watch"
19 error node v4.5.0
20 error npm  v3.10.8
21 error code ELIFECYCLE
22 error vajra@ watch: `ionic-app-scripts watch`
22 error Exit status 1
23 error Failed at the vajra@ watch script 'ionic-app-scripts watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the vajra package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     ionic-app-scripts watch
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs vajra
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls vajra
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

and my ionic info

wjz@bj:~/ion/vajra$ ionic info 

Your system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID:	Ubuntu Description:	Ubuntu 16.04.1 LTS 
Node Version: v4.5.0

Try upgrading node. 4.5.0 is hella old.

1 Like

Works quite ok for me, but still crashes from time to time:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.37-5
OS:
Node Version: v4.6.0

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\grego_000\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'watch',
1 verbose cli   '--color' ]
2 info using npm@3.9.3
3 info using node@v4.6.0
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle ionic-hello-world@~prewatch: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~prewatch: no script for prewatch, continuing
7 info lifecycle ionic-hello-world@~watch: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~watch: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~watch: PATH: C:\Users\grego_000\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Nomnio\Sandbox\PowerChords\node_modules\.bin;C:\Program Files (x86)\nodejs;C:\ProgramData\Oracle\Java\javapath;C:\Ruby193\bin;C:\PROGRAM FILES (X86)\INTEL\ICLS CLIENT\;C:\PROGRAM FILES\INTEL\ICLS CLIENT\;C:\WINDOWS\SYSTEM32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT;C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\DAL;C:\PROGRAM FILES (X86)\INTEL\INTEL(R) MANAGEMENT ENGINE COMPONENTS\IPT;C:\PROGRAM FILES (X86)\INTEL\OPENCL SDK\2.0\BIN\X86;C:\PROGRAM FILES (X86)\INTEL\OPENCL SDK\2.0\BIN\X64;C:\PROGRAMDATA\LENOVO\READYAPPS;C:\PROGRAM FILES (X86)\COMMON FILES\LENOVO\EASYPLUSSDK\BIN;C:\PROGRAM FILES (X86)\LENOVO\PASSWORD MANAGER\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Git\cmd;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\nodejs\;C:\Users\grego_000\.dnx\bin;C:\Program Files (x86)\Atmel\sam-ba_2.12\drv\;C:\Program Files (x86)\Atmel\sam-ba_2.12;C:\Program Files\nodejs;C:\Program Files\Java\jdk1.8.0_11\bin;C:\Program Files\apache-ant-1.9.4\bin;C:\Android\sdk\tools;C:\Android\sdk\platform-tools;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\grego_000\AppData\Local\Microsoft\WindowsApps;C:\Users\grego_000\AppData\Roaming\npm
10 verbose lifecycle ionic-hello-world@~watch: CWD: C:\Nomnio\Sandbox\PowerChords
11 silly lifecycle ionic-hello-world@~watch: Args: [ '/d /s /c', 'ionic-app-scripts watch' ]
12 silly lifecycle ionic-hello-world@~watch: Returned: code: 1  signal: null
13 info lifecycle ionic-hello-world@~watch: Failed to exec watch script
14 verbose stack Error: ionic-hello-world@ watch: `ionic-app-scripts watch`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\grego_000\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:245:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\grego_000\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:829:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid ionic-hello-world@
16 verbose cwd C:\Nomnio\Sandbox\PowerChords
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\grego_000\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch" "--color"
19 error node v4.6.0
20 error npm  v3.9.3
21 error code ELIFECYCLE
22 error ionic-hello-world@ watch: `ionic-app-scripts watch`
22 error Exit status 1
23 error Failed at the ionic-hello-world@ watch script 'ionic-app-scripts watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the ionic-hello-world package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     ionic-app-scripts watch
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs ionic-hello-world
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls ionic-hello-world
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

upgrading to node. 4.6.0 works

thanks.

Just want to confirm that karma and protractor tests works also great without the need to change the previous app code (ie using require() to include templates). So it’s possible to write code compatible with both Webpack and Rollup. If someone is interested on e2e/unit test here are the info.

if i add --dev in package.json, it sucks on

$ ionic run android -lc

Running 'run:before' npm script before run

> appt@ build /Projects/SL
> ionic-app-scripts build --dev

[23:05:22]  ionic-app-scripts 0.0.37-5 
[23:05:22]  build dev started ... 
[23:05:22]  clean started ... 
[23:05:22]  clean finished in 6 ms 
[23:05:22]  copy started ... 
[23:05:22]  transpile started ... 
[23:05:22]  lint started ... 
[23:05:25]  lint finished in 3.31 s 
[23:05:28]  transpile finished in 6.57 s 
[23:05:28]  webpack started ... 
[23:05:28]  copy finished in 6.72 s 
[23:05:36]  webpack finished in 7.52 s 
[23:05:36]  sass started ... 
[23:05:39]  sass finished in 2.89 s 
[23:05:39]  build dev finished in 17.00 s 

Same problem @nylex
It’s blocked on “build dev finished” when I build Anrdoid but not with ionic serve…

Hello,

I have a bug for debugging :slight_smile:

The context :

  • Node 6.1.3
  • Ionic-cli 2.1.4
  • OS Windows 7

In Chrome Debugger Tools, i lost the folder src with the ts file for debugging with version 0.0.37 and 0.0.38 of @ionic/app-scripts.

It 'ok with version 0.0.36

Just create a blank app with ionic-cli to view the bug ‘ionic start myApp blank --v2’

Have you got the same issue ?

Emmanuel

npm install @ionic/app-scripts@0.0.36 solve my problem FYI :wink:

Yes but with @ionic/app-scripts@0.0.36, I have a problem for integrate third library Pixijs with Rollup !
It’s ok for this with @ionic/app-scripts@0.0.37 !!

No solution work for debugging and Pixijs :frowning:

Bad luck, Ionic Team a solution ?

Those of you with freezing on build, read this whole thread. One cause of that was covered upthread (not having certain skeleton files like manifest.json in the expected places).

Hello,

@danbucholtz How can I add source maps to the webpack output? This used to be done by adding: devtool: 'source-map', to the webpack.config.js. I am guessing it’s more complicated since webpack is not in charge of transpiling right?

Thanks,

David

i already have manifest.json in src folder. :confused:

If you have a custom webpack config file, follow this issue.

Go ahead and update to 0.0.39, sourcemap support is in. I am working on “better” sourcemaps right now mapping all the way back to Typescript as we speak. That will be 0.0.40 and it’ll hopefully be out soon.

That is 100% on me. I was testing the “better” sourcemap support and removed the webpack sourcemaps. I forgot to add it back in before I published. Fortunately, we caught it after a couple hours today.

Thanks,
Dan

@nylex,

This is also fixed in 0.0.39. We hadn’t tested this particular use case but it is now in our testing script.

Thanks,
Dan

According to this link, it could be related to running out disk space.

Not sure. Can you dig in and then open up an issue on our Github if that doesn’t resolve it.

Thanks,
Dan

i just tried with 0.0.39 and it works! :smile:

i’m running ionic run android -lc but it does not refresh when i change ts files, am i missing something?