# Issues with Ionic Serve

**URL:** <https://forum.ionicframework.com/t/issues-with-ionic-serve/34734>\
**Category:** ionic-v1\
**Created:** [October 15, 2015, 5:07pm UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734 "2015-10-15T17:07:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianpurkiss](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brianpurkiss/32/92491_2.png) [@brianpurkiss](https://forum.ionicframework.com/u/brianpurkiss)\
**Post date:** [October 15, 2015, 5:07pm UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/1 "2015-10-15T17:07:23Z")

</div>

The weirdest part of this error is that I currently have two projects, one works, and the other doesn’t.

The one that works was one of ionic’s pre-built example apps, the sidemenu one I believe. The project that doesn’t work is one I purchased off of CodeCanyon to learn from.

For the project that doesn’t work, I can run an ionic build and an ionic emulate, just not the ionic serve.

```
Here's the error:

Error occured [Error: There was an error loading your ionic.project file: Unexpected token }]

TypeError: Utils.fail is not a function
    at Object.IonicTask.run (/usr/local/lib/node_modules/ionic/lib/ionic/serve.js:38:18)
    at Object.run (/usr/local/lib/node_modules/ionic/lib/cli.js:96:32)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:10)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3

Utils.fail is not a function (CLI v1.7.1)

```

I’ve checked bower.json, config.xml, gulpfile.js, ionic.project, and package.json for unclosed {}, but there aren’t any.

Anyone have any ideas?

```
Your system information:

Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.7.1
Ionic App Lib Version: 0.5.1-beta.0
ios-deploy version: 1.8.2 
ios-sim version: 5.0.2 
OS: Mac OS X El Capitan
Node Version: v4.2.1
Xcode version: Xcode 7.0.1 Build version 7A1001
```

---

<div class="post-metadata">

**Author:** ![habu](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@habu](https://forum.ionicframework.com/u/habu)\
**Post date:** [October 15, 2015, 8:06pm UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/2 "2015-10-15T20:06:28Z")

</div>

The problem seems you have some where in your code miss-match of brackets “}”. I think it is very helpful if you check all of your Angular Js Files for Error. Let me know if it doesn’t help!

---

<div class="post-metadata">

**Author:** ![brianpurkiss](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brianpurkiss/32/92491_2.png) [@brianpurkiss](https://forum.ionicframework.com/u/brianpurkiss)\
**Post date:** [October 15, 2015, 9:08pm UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/3 "2015-10-15T21:08:12Z")

</div>

That’s what I originally thought, but it’s weird that the error is being shown in the Ionic core.

I did check some files, but I didn’t dive into any of the Angular files, just the various config files.

I’ll look into Angular files, hopefully that’s the fix. Which would mean there’s a bug in the files I purchased, which would be annoying.

Oh well, at least I have a new direction to investigate - thanks! 😄

---

<div class="post-metadata">

**Author:** ![brianpurkiss](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brianpurkiss/32/92491_2.png) [@brianpurkiss](https://forum.ionicframework.com/u/brianpurkiss)\
**Post date:** [October 16, 2015, 3:02am UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/4 "2015-10-16T03:02:41Z")

</div>

So far all of the files have the appropriate number of brackets. Finding mismatching brackets would be… a pain to say the least.

Just keep digging…

---

<div class="post-metadata">

**Author:** ![Vaskort](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@Vaskort](https://forum.ionicframework.com/u/Vaskort)\
**Post date:** [January 12, 2016, 10:26am UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/5 "2016-01-12T10:26:52Z")

</div>

I had the exact same error as you,

the problem for me was inside ionic.project file

It was:

> {  
> “name”: “myApp”,  
> “app\_id”: “”  
> “watchPatterns”: [  
> “www/js/_",  
> "!www/css/\*\*/_”  
> ]  
> }

There was a comma missing after app\_id.

> {  
> “name”: “myApp”,  
> “app\_id”: “”,  
> “watchPatterns”: [  
> “www/js/_",  
> "!www/css/\*\*/_”  
> ]  
> }

Cheers

---

<div class="post-metadata">

**Author:** ![dongcclk](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dongcclk](https://forum.ionicframework.com/u/dongcclk)\
**Post date:** [January 14, 2016, 2:40am UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/6 "2016-01-14T02:40:07Z")

</div>

Thanks，I resolved this problem

---

<div class="post-metadata">

**Author:** ![ravikiran6763](https://avatars.discourse-cdn.com/v4/letter/r/8491ac/32.png) [@ravikiran6763](https://forum.ionicframework.com/u/ravikiran6763)\
**Post date:** [April 30, 2016, 12:26pm UTC](https://forum.ionicframework.com/t/issues-with-ionic-serve/34734/7 "2016-04-30T12:26:36Z")

</div>

how did you resolve ?  
i am getting the following error

TypeError: undefined is not a function  
at Object.IonicTask.run (C:\Users\abhijeet\AppData\Roaming\npm\node\_modules  
ionic\lib\ionic\serve.js:38:18)  
at Object.run (C:\Users\abhijeet\AppData\Roaming\npm\node\_modules\ionic\lib  
cli.js:95:32)  
at Object. (C:\Users\abhijeet\AppData\Roaming\npm\node\_modules\io  
nic\bin\ionic:9:10)  
at Module.\_compile (module.js:460:26)  
at Object.Module.\_extensions…js (module.js:478:10)  
at Module.load (module.js:355:32)  
at Function.Module.\_load (module.js:310:12)  
at Function.Module.runMain (module.js:501:10)  
at startup (node.js:129:16)  
at node.js:814:3

undefined is not a function (CLI v1.7.14)

Your system information:

Cordova CLI: 6.1.1  
Ionic Version: 1.2.4-nightly-1917  
Ionic CLI Version: 1.7.14  
Ionic App Lib Version: 0.7.0  
OS: Windows 8.1  
Node Version: v0.12.7
