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

ionic serve stuck? #441

Closed
asamuga opened this issue Nov 19, 2016 · 18 comments
Closed

ionic serve stuck? #441

asamuga opened this issue Nov 19, 2016 · 18 comments

Comments

@asamuga
Copy link

asamuga commented Nov 19, 2016

Short description of the problem:

When I run ionic serve, the process gets stuck at tslint. It never completes. Tslint usually gives warnigs like unused variable or module.

This started happening when I updated ionic from RC2 to dev. Following this post.
http://blog.ionic.io/improvements-to-ionic-build-process/

I've deleted node-modules, .temp folders and re-run npm install

What behavior are you expecting?

I expect ionic serve process to complete.

Steps to reproduce:

  1. http://blog.ionic.io/improvements-to-ionic-build-process/
  2. ionic serve

Which @ionic/app-scripts version are you using?
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.9.1
Xcode version: Not installed

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

This is the output that I get. After that, the process is just stuck

invicta@ubuntu:~/Desktop/newauth$ sudo ionic serve

> ionic-hello-world@ ionic:serve /home/invicta/Desktop/newauth
> ionic-app-scripts serve

[18:20:46]  ionic-app-scripts 0.0.45
[18:20:46]  watch started ...
[18:20:46]  build dev started ...
[18:20:46]  clean started ...
[18:20:46]  clean finished in 5 ms
[18:20:46]  copy started ...
[18:20:46]  transpile started ...
[18:20:49]  transpile finished in 3.06 s
[18:20:49]  webpack started ...
[18:20:49]  copy finished in 3.27 s
[18:20:56]  webpack finished in 6.66 s
[18:20:56]  sass started ...
[18:20:57]  sass finished in 1.47 s
[18:20:57]  build dev finished in 11.23 s
[18:20:58]  watch ready in 11.31 s
[18:20:58]  dev server running: http://localhost:8100/

[18:20:59]  tslint: src/pages/notification-details/notification-details.ts, line: 3
Unused import: 'Dashboard'

L2:  import { Events, NavController, NavParams } from 'ionic-angular';
L3:  import { Dashboard } from '../dashboard/dashboard';

[18:20:59]  tslint: src/providers/user-data.ts, line: 26
Unused variable: '_isAppInFocus'
[18:20:59]  tslint: src/providers/user-data.ts, line: 148

L25:          var tmpNotification = notification.payload;
L26:          var _isAppInFocus = notification.isAppInFocus;

Unused variable: 'returnedNotification'

L147:              if(data.status === 200){
L148:                  var returnedNotification = data.json().notification;

[18:20:59]  tslint: src/pages/login/login.ts, line: 3
[18:20:59]  tslint: src/pages/login/login.ts, line: 3
Unused import: 'FORM_DIRECTIVES'

L2:  import { NavController, MenuController, AlertController  } from 'ionic-angular';
L3:  import { FORM_DIRECTIVES,  ControlGroup } from 'angular2/angular2';

Unused import: 'ControlGroup'

L2:  import { NavController, MenuController, AlertController  } from 'ionic-angular';
L3:  import { FORM_DIRECTIVES,  ControlGroup } from 'angular2/angular2';

[18:20:59]  tslint: src/pages/websites-filter/websites-filter.ts, line: 91
[18:20:59]  tslint: src/pages/websites-filter/websites-filter.ts, line: 116
Unused variable: 'email'

L90:  var token = this.authservice.getUserToken();
L91:  var email = window.localStorage.getItem('email');
L92:  var headers = new Headers();

Unused variable: 'email'

L115:  var token = this.authservice.getUserToken();
L116:  var email = window.localStorage.getItem('email');
L117:  var headers = new Headers();

[18:20:59]  tslint: src/pages/filters/filters.ts, line: 96
[18:20:59]  tslint: src/pages/filters/filters.ts, line: 31
Duplicate variable: 'tmpMakes'

L95:    this._makes = tmpMakes;
L96:    var tmpMakes = [];

Unused variable: 'email'

L30:  var token = this.authservice.getUserToken();
L31:  var email = window.localStorage.getItem('email');
L32:  var headers = new Headers();

PACKAGE.JSON

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.45",
    "typescript": "^2.0.3"
  },
  "description": "newauth: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-crosswalk-webview",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard",
    "onesignal-cordova-plugin"
  ],
  "cordovaPlatforms": []
}

@danbucholtz
Copy link
Contributor

I cannot recreate this on a Mac. Anyone else having the same issue on Linux?

Thanks,
Dan

@DhruvGupta5
Copy link

i am stuck with same

@GeeKanJi
Copy link

The order has changed, tslint appears last in the console. But in the log we see "dev server running: http: // localhost: 8100 /"

I also thought it was stuck, but if you run chrome the app works

@danbucholtz
Copy link
Contributor

I am thinking it is just failing to open the browser automatically. Can you run this with --debug added to the ionic:serve npm script? Any additional information to help track this down would be appreciated. Right now I have no idea what is causing it and cannot recreate it so there isn't anything that I can do right now.

Thanks,
Dan

@danbucholtz
Copy link
Contributor

@thebasix, @jeromeXoo, @DhruvGupta5, can you start debugging and try to figure this out?

Thanks,
Dan

@GeeKanJi
Copy link

Sorry I thought the previous message was not addressed to me.

For me there is no problem, tslint messages appear at the end whereas in previous versions the command "ionic serve" ends with "server running: http: // localhost: 8100 /". (This is no longer the case)

I think it's just that, they're waiting for the rest of the message, but there's none, and that's normal.

A suggestion: maybe add a message at the end to confirm that everything is ok?

@DhruvGupta5
Copy link

@danbucholtz yes its working, just the browser is not opening automatically, thanks a ton.

additionally server and console errors are gone upon ionic run android -l -c -s , its extremely difficult to work without them

@danbucholtz
Copy link
Contributor

@DhruvGupta5, we are working on that. Can you try to figure out why ionic serve isn't launching the browser correctly?

Thanks,
Dan

@DhruvGupta5
Copy link

@danbucholtz , i will try but i am new to development, actually my first project. so chances are bleak

@danbucholtz
Copy link
Contributor

@DhruvGupta5, what OS are you on? What node --version are you on?

Thanks,
Dan

@DhruvGupta5
Copy link

@danbucholtz ubuntu 16.04 , node version- 6.9.1

@DhruvGupta5
Copy link

DhruvGupta5 commented Nov 22, 2016

@danbucholtz #425 would this investigation help ?

@jayeshanandani
Copy link

jayeshanandani commented Dec 27, 2016

@danbucholtz This issue happens only on Linux. It used to work earlier but after recent updates in ionic-app-scripts it has stopped working. Might be duplicate of #425

Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.48
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v4.5.0
Xcode version: Not installed

@danbucholtz
Copy link
Contributor

I believe this is fixed in app-scripts 1.0.0. Please let me know if it's not.

Thanks,
Dan

@JenniWelts
Copy link

Hi there!

I know this is an old thread but I'm experiencing similar kind of issues.
I'm sort of newbie with Ionic and really cannot figure out what's happening.

I've tried to create my first application, it opens it perfectly on http://localhost:8100. When I'm trying to go back to Terminal and continue my project, it's stuck on lint finished in 5.64s.

My Cordova version is 7.0.1 and Ionic 3.9.1. I'm using Mac and the OS is 10.12.5.

I've tried to reinstall Cordova and Ionic, no results. Any thoughts on this one?

Thanks a million

P.S. Here are the last lines that I see in Terminal:

[12:56:45] dev server running: http://localhost:8100/

[INFO] Development server running
Local: http://localhost:8100
External: http://192.XXX.X.XXX:8100

[12:56:51] lint finished in 5.64 s

@brunolm
Copy link

brunolm commented Jun 1, 2018

After using it multiple times it sometimes makes my node/npm get stuck.

I can run npm -v it does print the version, but never exist the process. I have to close the entire terminal.

Windows 10

@jitrani
Copy link

jitrani commented Jun 5, 2018

after type the ionic serve my browser is not coming automatically its terminated. if I m typing localhost:8100 then also it is not coming. instead of ionic serve if I m typing npm run ionic:serve --verbose then it's working. can anybody tell me why ionic serve is not working?

@JaviBecerra
Copy link

Hi,
I am experiencing the same issue as @jitrani:
-Running "ionic build" builds the app, runs the linter and ends with message "lint finished in 6.41 s"
-Running "npm run ionic:serve" the page loads properly on browser at localhost:8100, latest message on console is "lint finished in 6.29 s" after some tslint warnings regarding unused imports.
-Running "ionic serve": the console shows the same messages and linter warnings but "lint finished in .... s" never shows up and on the browser localhost:8100 only shows a blank page that keeps loading until the server is shutdown.

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

9 participants