Ionic-app-scripts: Ionic serve not working with 0.0.31

Created on 14 Oct 2016  Â·  22Comments  Â·  Source: ionic-team/ionic-app-scripts

Short description of the problem:

Running ionic serve on a Ionic2 RC0 app. Build fails telling its unable to find C:\Users\devarg\Documents\dev\project\app\src\app\main.dev.ts
but it is there...

What behavior are you expecting?

If builds ok in 0.0.30 it should also build ok in 0.0.31

Steps to reproduce:

  1. Update your package.JSON version of @ionic/app-scripts to 0.0.31
  2. Run npm install @ionic/app-scripts wait to end (no errors)
  3. Reinstalling 0.0.30 solves the issue
C:\Users\devarg\Documents\dev\project\app>npm install @ionic/app-scripts                                        
fetchMetadata -> request  | |######################---------------------------------------------------------------------------| 
fetchMetadata -> request  / |#######################--------------------------------------------------------------------------| 
fetchMetadata -> afterAdd | |##########################-----------------------------------------------------------------------| 
fetchMetadata -> get      \ |###########################----------------------------------------------------------------------| 
loadDep:bn.js             / |##############################-------------------------------------------------------------------| 
extract:@ionic/app-script | |#############################################################################--------------------| 
- [email protected] node_modules\tippex                                                                                              
[email protected] C:\Users\devarg\Documents\dev\project\app                                                       
+-- @ionic/[email protected]                                                                                                   
| +-- [email protected]                                                                                                             
| `-- [email protected]                                                                                         
`-- [email protected]                                                                                                               

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:                                                       
npm WARN notsup Not compatible with your operating system or architecture: [email protected]                                      

C:\Users\devarg\Documents\dev\project\app>ionic serve

[19:33:23]  lint finished in 5.29 s                                                                                             
[19:33:25]  transpile finished in 7.96 s                                                                                        
[19:33:25]  bundle started ...                                                                                                  
**unable to find C:\Users\devarg\Documents\dev\project\app\src\app\main.dev.ts**         

Which @ionic/app-scripts version are you using?
0.0.31

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
[email protected]

ionic info
Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.0-rc.0-201610041708
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Windows 10 Pro 64-bits ver 10.0.14393 compilation 14393
Node Version: v6.0.0

Most helpful comment

K, we've been able to figure out the issue. Hang in there.

All 22 comments

Same issue here on Windows. Same project works on OS X.

+1

Same problem. 0.0.31 is completely unusable on Windows. 0.0.30 works fine.

Same here in windows.

A lot of errors like:

All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.

in 0.0.31.

Downgraded to 0.0.30 and works fine. (Except others know issues).

Thanks for letting us know. We'll look into it and get a new release out.

In your package.json, can you add --debug to the end of the watch script, so it's like this: "watch": "ionic-app-scripts watch --debug" and report any errors you are seeing? At what step is it failing?

@adamdbradley @mhartington Once you run the command it fails where it can't find main.dev.ts and then browser starts with white screen

I think source url is messed up take a look at this: inverted slash in the "entry", i guess it
should be a simple fix so night doesn't get long D:

[ DEBUG! ]  entry: C:\Users\devarg\Documents\dev\project\app\src/app/main.dev.ts, dest:
C:\Users\devarg\Documents\dev\project\app>npm install @ionic/app-scripts                                                                                                            
fetchMetadata -> network  - |#####################################--------------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> 304      / |#########################################----------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> 304      | |############################################-------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> afterAdd - |############################################-------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> headers  / |#############################################------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> resolveW | |#############################################------------------------------------------------------------------------------------------------------------------------| 
fetchMetadata -> get      - |#############################################################--------------------------------------------------------------------------------------------------------| 
- [email protected] node_modules\tippex                                                                                                                                                                  
[email protected] C:\Users\devarg\Documents\dev\project\app                                                                                                                           
+-- @ionic/[email protected]                                                                                                                                                                       
| +-- [email protected]                                                                                                                                                                                 
| `-- [email protected]                                                                                                                                                             
`-- [email protected]                                                                                                                                                                                   
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:                                                                                                                           
npm WARN notsup Not compatible with your operating system or architecture: [email protected]                                                                                                          

C:\Users\devarg\Documents\dev\project\suricata-ui>ionic serve

Running 'serve:before' npm script before serve
> [email protected] watch C:\Users\devarg\Documents\dev\project\app
> ionic-app-scripts watch --debug
[23:02:49]  ionic-app-scripts 0.0.31
[23:02:49]  watch started ... MEM: 65.3MB
[23:02:49]  build dev started ... MEM: 65.4MB
[23:02:49]  clean started ... MEM: 65.4MB
[ DEBUG! ]  clean C:\Users\devarg\Documents\dev\project\app\www\build MEM: 65.4MB
[23:02:49]  clean finished in 5 ms MEM: 65.4MB
[23:02:49]  copy started ... MEM: 65.4MB
[ DEBUG! ]  worker created, task: lint, pid: 13576 MEM: 65.9MB
[23:02:49]  transpile started ... MEM: 66.0MB
[ DEBUG! ]  ts.createProgram, cachedProgram: false MEM: 72.6MB
[ DEBUG! ]  tslint config: C:\Users\devarg\Documents\dev\project\app\tslint.json MEM:
            37.4MB
[23:02:49]  lint started ... MEM: 37.7MB
[23:02:54]  lint finished in 5.09 s MEM: 120.8MB
[ DEBUG! ]  worker resolve, task: lint, pid: 13576 MEM: 120.8MB
[23:02:56]  transpile finished in 7.67 s MEM: 222.9MB
[23:02:56]  bundle started ... MEM: 222.9MB
[ DEBUG! ]  entry: C:\Users\devarg\Documents\dev\project\app\src/app/main.dev.ts, dest:
            C:\Users\devarg\Documents\dev\project\app\www\build\main.js, cache: undefined,
            format: iife MEM: 222.9MB
unable to find C:\Users\devarg\Documents\dev\project\app\src\app\main.dev.ts

[ DEBUG! ]  worker exited, task: lint, pid: 13576 MEM: 223.4MB
[23:02:56]  copy finished in 7.83 s MEM: 223.4MB
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $

K, we've been able to figure out the issue. Hang in there.

A fix was just published, please run npm install @ionic/app-scripts@latest --save-dev and let us know how it goes. Thanks for the reports!

UPDATE
Turn out that it is my mistake as I did not install one of third party plugins. The fix works as expected. Thank you very much.

ORIGINAL COMMENT
Updated to the latest version but still having the same problem. main.js and main.css are not generated in my build folder. Here is the list of outputs including debugs.

[11:39:58] transpile started ...
[11:39:58] lint started ...
[11:41:36] lint finished in 5.01 s MEM: 143.7MB
[ DEBUG! ] worker resolve, task: lint, pid: 8607 MEM: 143.7MB
[11:41:39] transpile finished in 7.78 s MEM: 251.6MB
[11:41:39] bundle started ... MEM: 251.6MB
[ DEBUG! ] entry: /Users/USERNAME/APPNAME/src/app/main.dev.ts, dest: /Users/USERNAME/APPNAME/www/build/main.js,
cache: undefined, format: iife MEM: 251.6MB
[ DEBUG! ] worker exited, task: lint, pid: 8607 MEM: 252.7MB
[11:41:39] copy finished in 7.86 s MEM: 252.8MB

@mhartington @adamdbradley Thank you guys, now it's working.
It still has the issue that randomly when live-reload recompiles, browser screen gets white, and needs a refresh to get back on track. But this is a good start! It feels not faster but a bit more stable.

Great work, keep it going!

PS: As for me, this issue might be closed, but I'll let you decide if you want to keep this until others have accomplished their issues regarding to this too.

Working for me now. Thanks!

Just made another release that should improve rebuild times for just HTML changes. Please let us know how it goes, thanks

@adamdbradley -- I had previously noticed that HTML changes were not caught reliably. I just did a simple HTML change w/ 0.0..33 and the update was very fast and it worked. However, subsequent template updates were not caught and didn't trigger a rebuild.

ionic $ [23:31:38] template update started ... JS changed: C:\sk\src\...\www\build\main.js [23:31:38] template update finished in 308 ms [23:31:38] watch ready

I've duplicated this -- only the very 1st template change after initial build is being noticed.

GREAT!!!!
With 0.0.33 I can debug in my device finally!!!!!
The only change I have to do is
Change "run:before": "build" to "run:before": "watch" in package.json
With this change now
"ionic run android -l"
works fine and I can debug properly in VSCode with cordova tools.

@jmesa-sistel I have always been able to debug in android, pre-rc and now with the latest tools, and never needed to change "run:before" or anything. You can also hook to your app installed in your device from chrome-debugger! ;) Which is really cool for diagnosing template issues and computed styles

So, safe to close this issue? Anyone else having serving issues?

@mhartington Yes, the origin of the issue is definitely solved, I think further improvements, proposals and adjustments for each one particular needs may be discussed at ionic forum.

Cool. Thanks for hanging in there folks!

I am not able to use ionic serve after updating from 0.0.30 to 0.0.31+.

When I run ionic serve after updating it runs normally but there is only polyfills.js under src/www/build. main.js and main.css are missing.

Ionic run browser works.

Console output (app-scripts v0.0.31):

ionic serve

Running 'serve:before' npm script before serve
> kodiak_mobile@ watch /home/USERNAME/code/APPNAME
> ionic-app-scripts watch --debug
[15:04:33]  ionic-app-scripts 0.0.31 
[15:04:33]  watch started ... MEM: 92.4MB 
[15:04:33]  build dev started ... MEM: 92.4MB 
[15:04:33]  clean started ... MEM: 92.4MB 
[ DEBUG! ]  clean /home/USERNAME/code/APPNAME/www/build MEM: 92.4MB 
[15:04:33]  clean finished in 3 ms MEM: 92.6MB 
[15:04:33]  copy started ... MEM: 92.6MB 
[ DEBUG! ]  worker created, task: lint, pid: 12571 MEM: 92.8MB 
[15:04:33]  transpile started ... MEM: 92.8MB 
[ DEBUG! ]  ts.createProgram, cachedProgram: false MEM: 95.0MB 
[ DEBUG! ]  tslint config: /home/USERNAME/code/APPNAME/tslint.json MEM: 45.8MB 
[15:04:34]  lint started ... MEM: 48.1MB 
[15:04:35]  lint finished in 1.86 s MEM: 157.4MB 
[ DEBUG! ]  worker resolve, task: lint, pid: 12571 MEM: 157.4MB 
[15:04:36]  transpile finished in 2.26 s MEM: 239.3MB 
[15:04:36]  bundle started ... MEM: 239.3MB 
[ DEBUG! ]  entry: src/app/main.dev.ts, dest: /home/USERNAME/code/APPNAME/www/build/main.js, 
            cache: undefined, format: iife MEM: 239.3MB 
[ DEBUG! ]  worker exited, task: lint, pid: 12571 MEM: 240.3MB 
[15:04:36]  copy finished in 2.29 s MEM: 240.3MB 
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://localhost:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $ 

Ionic info:

Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: LinuxMint Description:  Linux Mint 18 Sarah 
Node Version: v4.6.0

@devarg Then the watch process is not working, I can modify the code and automatically the bundle is regenerated (but not always, there are problems with the templates) and the application on the mobile device is reloaded.

@Katur7 as the thread says 0.0.31 is not working, update to 0.0.32 or higher to get it back to work.

Was this page helpful?
0 / 5 - 0 ratings