Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Ionic serve hangs after build dev finished #282

Closed
alan-agius4 opened this issue Oct 31, 2016 · 26 comments
Closed

Ionic serve hangs after build dev finished #282

alan-agius4 opened this issue Oct 31, 2016 · 26 comments

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Oct 31, 2016

Short description of the problem:

Ionic serve is hangs when manifest.json and/or service-worker.js are missing, As shown below
image

What behavior are you expecting?

When I add both files it works as expected, thus the warnings are infact errors?
image

Versions

@ionic/app-scripts: 0.0.38
ionic: 2.1.4
node: 6.9.1
npm: 3.10.8
OS: Window 7 and Window 10
@marcoturi
Copy link
Contributor

You simply should move them to. /src folder. Yes, in the last releases they were in the aseets folder. Now they should be in src. Dunno if its a regression.

@jgw96
Copy link
Contributor

jgw96 commented Oct 31, 2016

Note to team: I cannot reproduce this using node 6.9.1 and npm 3.10.8 on my mac running the latest macOS. Maybe this is a windows specific issue then?

@jgw96 jgw96 added the bug label Oct 31, 2016
@danbucholtz
Copy link
Contributor

I cannot recreate on MacOS with Node 4.x LTS either.

Thanks,
Dan

@alan-agius4
Copy link
Contributor Author

Repo to replicate the issue

https://github.com/alan-agius4/ionic-app-scripts-issues

On Monday, 31 October 2016, Dan Bucholtz [email protected] wrote:

I cannot recreate on MacOS with Node 4.x LTS either.

Thanks,
Dan


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#282 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQv-WlP-vTFeIIjlvdfksC0oSpeAa3Dcks5q5h0cgaJpZM4Kkv01
.

@alan-agius4
Copy link
Contributor Author

Note, on another machine adding the files still didn't solve the issue. Which means there might be several causes of the issue.

@kabus202
Copy link

kabus202 commented Nov 1, 2016

moving service-worker.js and manifest.json to src fixing the problem for me

@jgw96
Copy link
Contributor

jgw96 commented Nov 1, 2016

@alan-agius4 If you remove the custom webpack config (like #290 is mentioning) does this fix this issue for you?

@pickupman
Copy link

Unable to run ionic serve without a custom configuration.

Running;
ionic serve

Gulp version:  CLI version 3.9.0                                                                                             
Gulp local:   Local version 3.9.0                                                                                            
Ionic Framework Version: 2.0.0-rc.1                                                                                          
Ionic CLI Version: 2.1.4                                                                                                     
Ionic App Lib Version: 2.1.2                                                                                                 
Ionic App Scripts Version: 0.0.39                                                                                            
OS: Windows 10                                                                                                                          
Node Version: v6.8.1 

No custom build scripts or configuration, and runs fine until it hangs on build_dev finished

@alan-agius4
Copy link
Contributor Author

@jgw96 I was unable to remove the custom webpack config file as my app won't build. What we noticed was that on Window 10, after the hang on build_dev finished it works fine after you do a change on a file that triggers the process again.

@danbucholtz danbucholtz self-assigned this Nov 2, 2016
@alan0xd7
Copy link

alan0xd7 commented Nov 2, 2016

What I have noticed is that if there are too many files in the project folder, ionic serve will hang after the watch ready line, and it doesn't actually start the web server and launch browser.

I have noticed this because I just added a bunch of emoji artwork from EmojiOne, there are about 1,800 files.

After I removed all the emoji files, ionic serve works fine again.

I hope this information helps in resolving this issue, and I will post follow ups if I found anything new.

@ionic/app-scripts: 0.0.39
OS: Windows 10

@alan-agius4
Copy link
Contributor Author

I actually only have like 10 files and still hangs

On Wednesday, 2 November 2016, Alan [email protected] wrote:

What I have noticed is that if there are too many files in the project
folder, ionic serve will hang after the watch ready line, and it doesn't
actually start the web server and launch browser.

I have noticed this because I just added a bunch of emoji artwork from
EmojiOne https://github.com/Ranks/emojione/tree/master/assets/png,
there are about 1,800 files.

After I removed all the emoji files, ionic serve works fine again.

I hope this information helps in resolving this issue, and I will post
follow ups if I found anything new.

@ionic/app-scripts: 0.0.39
OS: Windows 10


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#282 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQv-Wm5nemCxIuKA96Mg9cU8hJMyyO_Vks5q6PFYgaJpZM4Kkv01
.

@pickupman
Copy link

I have a large project with 30 pages in my app. After changing a file, ionic serve will execute and open the browser. Same as @alan-agius4 mentioned. If I run ionic serve, and do nothing else it just stays a build_dev finished. Browser never opens at all.

@aexei
Copy link

aexei commented Nov 4, 2016

I have the same problem and my project contains about 2000 small images. I figured out this only occurs with 'serve'. When i build the app it works fine.

@morious
Copy link

morious commented Nov 5, 2016

getting the following on windows:

[19:23:24]  copy: Error copying "C:\dev\...\src\manifest.json" to
            "C:\dev\...\www\manifest.json": File not found
[19:23:24]  copy: Error copying "C:\dev\...\src\service-worker.js" to
            "C:\dev\...\www\service-worker.js": File not found

ionic serve is not passing 'build dev finished' and hangs

@morious
Copy link

morious commented Nov 5, 2016

In case anyone runs to a similar issue, I fixed my:

  1. copying the files to the 'src' folder.
  2. remove node_modules and running npm install (upgrading to rc.2)

Thx

@jayeshanandani
Copy link

Tested on MAC as well as Linux with 4.x LTS version of node. It runs perfectly fine in MAC while in Linux you need to create those files inside /src folder to get the build running.

I am using following ionic configuration for MAC and Linux:

Cordova CLI: 6.4.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.39

@tkem
Copy link

tkem commented Nov 7, 2016

Same behavior running Debian GNU/Linux: need to touch both manifest.json and service-worker.js for ionic serve to work as before. IMHO the "Error copying..." message for these files is also misleading - my app doesn't use them and I removed references from index.html, so I think the build scripts should just treat these as optional...

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.39
OS: Distributor ID: Debian Description: Debian GNU/Linux 7.11 (wheezy) 
Node Version: v5.12.0

@kashban
Copy link

kashban commented Nov 7, 2016

Same issue here and adding those files to my existing RC0 project fixed this grave error. For service-worker.js I got an error message while building but the missing manifest.json completely stopped ionic serve from opening up the web server while giving no indication whatsoever. This just cost me two (!) hours just because the CLI isn't able to issue a meaningful error message and there also is nothing about those two files on the changelogs.

Ionic Dev Team: It's great if your release candidates work with fresh new projects created from starter templates, but some of us are working on actual projects here and cannot start from anew every time a new version comes out. So please try to be verbose on any changes that might have an impact on us and test new releases on older projects too. If you add new files or move some please state this in the changelogs.

@cmaart
Copy link
Contributor

cmaart commented Nov 8, 2016

Using [email protected] The hanging after "build dev finished" happens to me too. Even though i already pasted in a manifest.json and a service-worker.js. Funny thing is when i change something in the src folder, like adding a file, it detects changes, recompiles and immediately opens the browser

It seems the issue is that the copy task never finishes

EDIT: As it turns out i was missing the package ionicons. I had a custom copy.config.js but it still tries to copy it and will silently fail if this is missing in node_modules.

@kashban
Copy link

kashban commented Nov 11, 2016

Failing silently is the real problem here.

@danbucholtz
Copy link
Contributor

We have increased our testing efforts on Windows so I will take a look at this now.

@danbucholtz
Copy link
Contributor

@kashban and @cmaart, yeah, you guys are right. We need to show errors in that case. I, too, am seeing a silent failure here. Looking into it.

Thanks,
Dan

@danbucholtz
Copy link
Contributor

@alan-agius4, @kashban and @cmaart,

I think I fixed this. Can you test our nightly build when you get a chance and see if there are any other ill effects from this? It seems to be working well on Windows and Mac.

npm install @ionic/app-scripts@nightly

Thanks,
Dan

@kashban
Copy link

kashban commented Nov 12, 2016

Thanks Dan, will do once I am in the office again on Monday.

@rgbsuede
Copy link

I, too, have this problem. A silent failure wherein ionic serve does not trigger a build, nor do any changes trigger a live update.

npm install @ionic/app-scripts@nightly also does not solve this issue, whereas adding

"serve:before": "watch" to the scripts section of package.json is a functional workaround for the time-being.

Windows 10

@danbucholtz
Copy link
Contributor

@joshbabb,

Can you try to identify what the issue is? What I was seeing in my testing was an issue with trying to watch a file that doesn't exist and that code never resolving due to the dependency not working as expected. We added a fallback that if the watch does not initialize on a file in X amount of seconds, it fails and logs and error to the user. Are you seeing that?

The script section of package.json should look like this:

"scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  }

Please let me know.

Thanks,
Dan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests