diegonetto / generator-ionic

Build hybrid mobile apps using the Ionic Framework
MIT License
1.74k stars 336 forks source link

grunt serve "Can't Connect to the Server" #210

Closed EmilioAiolfi closed 9 years ago

EmilioAiolfi commented 9 years ago

'grunt serve' dont execute 'ionic serve' I did a test with a new project with generator and did not work

If execute 'grunt ionic:serve' work.. =/

How to fix it ?

screen shot 2015-06-14 at 21 54 04

screen shot 2015-06-14 at 21 50 09

molavec commented 9 years ago

I have the same problem, but in my case I have two old projects that I use 'grunt serve' and work prefect. When I create new project I have the same problem. It's like ionic serve exists ("Done, without errors."). Any suggestion how to detect the bug?

EmilioAiolfi commented 9 years ago

@molavec, I'm trying debug the problem... I think its may be 'concurrent' task. Specifically in this - 'grunt.config('concurrent.ionic.tasks', ['ionic:serve', 'watch']);'

dtalay commented 9 years ago

I think the problem is the port being used http://forum.ionicframework.com/t/ionic-serve-default-port/7779

Unfortunately, I've been trying to change the port and no luck.

dtalay commented 9 years ago

Confirmed. Port is the problem. I tried using ionic serve --port 8080 and it worked.

[EDIT] Nope it doesn't work. I managed to change the port for running grunt serve and it still doesn't work. What more surprising is that the lower versions doesn't have any problem running in 8100 port.

yanCode commented 9 years ago

Having the same problem in Mac os, a workaround is to use 'grunt ionic:serve' , @m00g33k is correct this issue didn't exist on older versions.

Jerome2606 commented 9 years ago

Hi,

I have the same problem on Windows 8.1. I update the project and now 'grunt serve' stops the server as soon as it started. 'grunt serve:compress' works

dtalay commented 9 years ago

Since everyone is clearly having an issue, we should file a bug report.

EmilioAiolfi commented 9 years ago

Guys, check line - grunt.config('concurrent.ionic.tasks', ['ionic:serve', 'watch']); Remove the 'watch', the ''ionic:serve'' not continue...

I think the problem is the concurrent task

screen shot 2015-06-16 at 12 00 55

ebosveld commented 9 years ago

I have the same problem. Strange thing is, if I run ionic serve standalone it will run. It started happening after I updated my components...

ebosveld commented 9 years ago

I think I found the problem. The author of grunt-concurrent updated the package 3 days ago. This messes things up for some reason. If I go back to the previous version (npm install grunt-concurrent@1.0.0) the task runs without problems.

EmilioAiolfi commented 9 years ago

Good @ebosveld! The problem is grunt-concurrent@1.0.1! Go back to the previous version grunt-concurrent@1.0.0 resolved.

oori commented 9 years ago

The issue is with grunt-concurrent "logConcurrentOutput", because of https://github.com/sindresorhus/grunt-concurrent/pull/52. setting it to "false" in the gruntfile bypasses this issue, or downgrading to 1.0.0 as @ebosveld suggested.

cicerohen commented 9 years ago

@oori tank's. Helped me a lot. :D