Ionic serve needs restart for every second change i do


#1

I use ionic serve when developing my apps. It works fine for changes on html, and css files, but when i change a .ts file changes are updated in my browser on the first reload. Next time, the changes are not available in the browser, and i need to stop ionic serve, and start it back up again.

Anyone having the same problem? Is there some setting in webpack.config.js that needs to be set? It’s strange, though, since it works fine on the first save/refresh.

Thanks in advance.


#2

Hmm, could you provide your ionic-cli version? ionic v

I haven’t seen this before, but the CLI and v2’s build process has been changing pretty fast so there may be something going on there.


#3

This happens to me too. I thought that was normal.

I am using 2.0.0-beta.23

That is when I write ionic -v


#4

Here’s my ionic info:

Your system information:

Cordova CLI: 4.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: 1.8.4
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.3 Build version 7D175

I can also add that this happens on both my home computer and my work one. I’ll find the ionic info once i get to work in a couple of hours.

Here’s the ionic info from my office computer:
Your system information:

Cordova CLI: 4.2.0
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: Not installed
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.3.1
Xcode version: Xcode 7.3 Build version 7D175


#5

@larschla could you update the version of ionic-cli you have? Beta 19 is pretty old.

npm install -g ionic

Then start a new project and see if the issue is still there.


#6

That worked fine for the new project, except that i get this message every time i save:

TypeScript error: /Users/larschla/apps/testapp/node_modules/angular2/src/facade/promise.d.ts(1,10): Error TS2661: Cannot re-export name that is not defined in the module.

What is worse, is that my ionic version 1 apps has stopped working with following messages:

$ ionic build android
WARN: ionic.project has been renamed to ionic.config.json, please rename it.
Uh oh! Looks like you’re missing a module in your gulpfile:
Cannot find module ‘gulp’

Do you need to run npm install?

So i run npm install, and try again:

$ ionic build android
There is an error in your gulpfile:
Error: libsass bindings not found. Try reinstalling node-sass?
at getBinding (/Users/larsschlanbusch/utvikling/Flexite/adapt-it/mobile/eluapp/node_modules/node-sass/lib/index.js:22:11)
at Object. (/Users/larsschlanbusch/utvikling/Flexite/adapt-it/mobile/eluapp/node_modules/node-sass/lib/index.js:188:23)
at Module._compile (module.js:425:26)
at Object.Module._extensions…js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/Users/larsschlanbusch/utvikling/Flexite/adapt-it/mobile/eluapp/node_modules/gulp-sass/index.js:3:17)
at Module._compile (module.js:425:26)

I need to be able to work on both v1 and v2 of ionic, since some of my old apps are written in v1. So this more or less breaks everything for me.


#7

npm install -g typescript this should solve ur problem


#8

Shouldnt he use the beta stream? i.e. npm install -g ionic@beta ?