# Ionic serve --lab don't work in RC2

**URL:** <https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862>\
**Category:** ionic-v3\
**Created:** [November 11, 2016, 3:54am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862 "2016-11-11T03:54:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chanyap92](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@chanyap92](https://forum.ionicframework.com/u/chanyap92)\
**Post date:** [November 11, 2016, 3:54am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/1 "2016-11-11T03:54:38Z")

</div>

after i just upgrade my ionic from beta to RC i am unable to use ionic serve --lab,  
this error is showing on browser “Cannot GET //\_\_ion-dev-server/ionic\_lab.html”

---

<div class="post-metadata">

**Author:** ![chanyap92](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@chanyap92](https://forum.ionicframework.com/u/chanyap92)\
**Post date:** [November 11, 2016, 4:18am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/2 "2016-11-11T04:18:57Z")

</div>

and when i run on my android phone with “ionic run android --device --livereload”. the livereload seems not functioning at all…everytime i change my code i still need to rebuild to see the changes.

---

<div class="post-metadata">

**Author:** ![ThomasWhite](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@ThomasWhite](https://forum.ionicframework.com/u/ThomasWhite)\
**Post date:** [November 11, 2016, 4:42am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/3 "2016-11-11T04:42:18Z")

</div>

I am also getting this same issue with the “Cannot GET //\_\_ion-dev-server/ionic\_lab.html” error whenever I try to run labs. I have a fresh install of everything and have started a new blank project.

---

<div class="post-metadata">

**Author:** ![chanyap92](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@chanyap92](https://forum.ionicframework.com/u/chanyap92)\
**Post date:** [November 11, 2016, 5:49am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/4 "2016-11-11T05:49:42Z")

</div>

waiting someone who can solve this issues

---

<div class="post-metadata">

**Author:** ![xuanlv](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/xuanlv/32/104584_2.png) [@xuanlv](https://forum.ionicframework.com/u/xuanlv)\
**Post date:** [November 11, 2016, 10:20am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/5 "2016-11-11T10:20:01Z")

</div>

the same problem with me.  
[root@localhost MyIonic2Project]# ionic info  
My system information:  
Cordova CLI: 6.4.0  
Ionic Framework Version: 2.0.0-rc.2  
Ionic CLI Version: 2.1.8  
Ionic App Lib Version: 2.1.4  
Ionic App Scripts Version: 0.0.43  
ios-deploy version: Not installed  
ios-sim version: Not installed  
OS: Linux 4.4  
Node Version: v7.1.0  
Xcode version: Not installed

pls help me .

---

<div class="post-metadata">

**Author:** ![stwelgemoed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/stwelgemoed/32/104585_2.png) [@stwelgemoed](https://forum.ionicframework.com/u/stwelgemoed)\
**Post date:** [November 11, 2016, 10:37am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/6 "2016-11-11T10:37:34Z")

</div>

I had the same issue so I decided to remove the ionic: from the scripts section and just leave build, serve and watch.

My scripts section now looks like this :

```
"build": "ionic-app-scripts build",
"serve": "ionic-app-scripts serve",
"watch": "ionic-app-scripts watch"

```

That works for me now but not sure if it is the correct final solution.

---

<div class="post-metadata">

**Author:** ![stwelgemoed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/stwelgemoed/32/104585_2.png) [@stwelgemoed](https://forum.ionicframework.com/u/stwelgemoed)\
**Post date:** [November 11, 2016, 11:08am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/7 "2016-11-11T11:08:25Z")

</div>

To get live reload working on run you can add this to your scripts section :

“run:before”: “watch”

Make sure that you also have watch defined in your scripts so :

“watch”: “ionic-app-scripts watch”

If you want to have live reload work for emulate, you will need this in your scripts section :

“emulate:before”: “watch”

---

<div class="post-metadata">

**Author:** ![Chris1234567899](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@Chris1234567899](https://forum.ionicframework.com/u/Chris1234567899)\
**Post date:** [November 11, 2016, 5:41pm UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/8 "2016-11-11T17:41:11Z")

</div>

Having the same issue…

Where do I find that section now? That looks similar to the previous used gulp, but I can’t find it.  
Sorry for maybe stupid question 😉

---

<div class="post-metadata">

**Author:** ![stwelgemoed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/stwelgemoed/32/104585_2.png) [@stwelgemoed](https://forum.ionicframework.com/u/stwelgemoed)\
**Post date:** [November 14, 2016, 6:04am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/9 "2016-11-14T06:04:42Z")

</div>

This is in your package.json. You should see a section called “scripts”.

Mine has the following in there:

“scripts”: {  
“build”: “ionic-app-scripts build”,  
“watch”: “ionic-app-scripts watch”,  
“serve:before”: “watch”,  
“emulate:before”: “watch”,  
“deploy:before”: “build”,  
“build:before”: “build”,  
“run:before”: “watch”  
}

---

<div class="post-metadata">

**Author:** ![chanyap92](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@chanyap92](https://forum.ionicframework.com/u/chanyap92)\
**Post date:** [November 14, 2016, 6:14am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/10 "2016-11-14T06:14:22Z")

</div>

this method solve my problem…now i can use ionic serve --lab…thanks

---

<div class="post-metadata">

**Author:** ![chanyap92](https://avatars.discourse-cdn.com/v4/letter/c/a3d4f5/32.png) [@chanyap92](https://forum.ionicframework.com/u/chanyap92)\
**Post date:** [November 14, 2016, 6:28am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/11 "2016-11-14T06:28:21Z")

</div>

sometime when you modify the scss file and save…the serve page will have problem of losing all css file and you have to refresh to fix it…

---

<div class="post-metadata">

**Author:** ![gtejwani](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@gtejwani](https://forum.ionicframework.com/u/gtejwani)\
**Post date:** [November 14, 2016, 3:10pm UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/12 "2016-11-14T15:10:55Z")

</div>

package.json and remove “ionic:serve”

“scripts”: { “ionic:build”: “ionic-app-scripts build”, “ionic:serve”: “ionic-app-scripts serve” },

Remove “ionic:serve”

“scripts”: { “ionic:build”: “ionic-app-scripts build” },

---

<div class="post-metadata">

**Author:** ![Lilibayo](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Lilibayo](https://forum.ionicframework.com/u/Lilibayo)\
**Post date:** [November 14, 2016, 10:39pm UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/13 "2016-11-14T22:39:17Z")

</div>

Thank you for this solution. Been trying to figure this out all weekend.

I know this might be a bit to much, but can you please explain what your script is doing and why the default ones didn’t work (shown below)  
scripts": {  
“ionic:build”: “ionic-app-scripts build”,  
“ionic:serve”: “ionic-app-scripts serve”  
}

Thanks again for the magical working script!!!

---

<div class="post-metadata">

**Author:** ![stwelgemoed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/stwelgemoed/32/104585_2.png) [@stwelgemoed](https://forum.ionicframework.com/u/stwelgemoed)\
**Post date:** [November 15, 2016, 5:09am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/14 "2016-11-15T05:09:34Z")

</div>

To be honest, I didn’t dig further as to why the defaults were not working. I have a TODO for this weekend to figure out why exactly. I can only assume it is a bug introduced with RC2 but will confirm this weekend.

In terms of the pieces I added, that just adds before events to each action so in this case, allows us to setup watch before we serve or emulate or run so we can have live reloading again.

---

<div class="post-metadata">

**Author:** ![Lilibayo](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Lilibayo](https://forum.ionicframework.com/u/Lilibayo)\
**Post date:** [November 15, 2016, 5:30am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/15 "2016-11-15T05:30:20Z")

</div>

Thank you so much. You really saved me 3 days of debugging.

I’m still very new at all of this + npm scripts. I’m reading on npm scripts now and learning about the before thing.  
If you are able to figure it out this weekend, I would love if you could break it down for the rest of us.

Do you by any chance know what happens when we run ionic serve?  
Does it just go down the script section doing those things one by one?

---

<div class="post-metadata">

**Author:** ![stwelgemoed](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/stwelgemoed/32/104585_2.png) [@stwelgemoed](https://forum.ionicframework.com/u/stwelgemoed)\
**Post date:** [November 15, 2016, 6:04am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/16 "2016-11-15T06:04:41Z")

</div>

The package.json just instructs what needs to run when you call a specific command or what needs to run before.

This in turn will most likely execute the scripts found in node\_modules@ionic\app-scripts\dist which contains the scripts for build, watch, serve etc.

---

<div class="post-metadata">

**Author:** ![Lilibayo](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Lilibayo](https://forum.ionicframework.com/u/Lilibayo)\
**Post date:** [November 15, 2016, 6:43am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/17 "2016-11-15T06:43:36Z")

</div>

@stwelgemoed you sir are fantastic.  
Thank you.

---

<div class="post-metadata">

**Author:** ![raae](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/raae/32/72812_2.png) [@raae](https://forum.ionicframework.com/u/raae)\
**Post date:** [November 23, 2016, 11:17am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/18 "2016-11-23T11:17:47Z")

</div>

I upgraded everything to latest yesterday and set my scripts to:

```
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"ionic:watch": "ionic-app-scripts watch"

```

and `ionic serve --lab` works again.

`ionic -v` gives me 2.1.12  
My project app-script dependency is: `"@ionic/app-scripts": "0.0.46"`

---

<div class="post-metadata">

**Author:** ![yasirpanjsheri](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yasirpanjsheri](https://forum.ionicframework.com/u/yasirpanjsheri)\
**Post date:** [January 11, 2017, 10:56am UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/19 "2017-01-11T10:56:59Z")

</div>

hi, I am also facing this problem… ionic serve --lab not working , any suggestion??

```
       "scripts": {
          "ionic2-custom-icons": "ionic2-custom-icons",
          "build:before": "ionic2-custom-icons",
          "serve:before": "ionic2-custom-icons",
          "ionic:build": "ionic-app-scripts build",
          "ionic:serve": "ionic-app-scripts serve"
         },

```

ionic info:

```
   Cordova CLI: 6.4.0 
   Ionic Framework Version: 2.0.0-rc.4
   Ionic CLI Version: 2.1.18
   Ionic App Lib Version: 2.1.9
   Ionic App Scripts Version: 0.0.48
   ios-deploy version: Not installed
   ios-sim version: Not installed
   OS: Linux 4.8
   Node Version: v7.2.1
   Xcode version: Not installed
```

---

<div class="post-metadata">

**Author:** ![davigonz](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@davigonz](https://forum.ionicframework.com/u/davigonz)\
**Post date:** [February 6, 2017, 8:25pm UTC](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862/20 "2017-02-06T20:25:38Z")

</div>

I’m having the same problem with this ionic info:

```
Cordova CLI: 6.5.0 
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v4.2.6
Xcode version: Not installed

```

Any solution? Thx!

[Next page](https://forum.ionicframework.com/t/ionic-serve-lab-dont-work-in-rc2/69862.md?page=2)
