Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uh oh! There's a syntax error in your ionic.config.json file: SyntaxError: Unexpected token } in JSON at position 82 #1952

Closed
jgw96 opened this issue Mar 3, 2017 · 4 comments

Comments

@jgw96
Copy link
Contributor

jgw96 commented Mar 3, 2017

From @ferminako on March 3, 2017 7:43

Ionic version: (check one with "x")
[ ] 1.x
[ x] 2.x

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

As soon as you include in your ionic.config.json a proxie list like:
"proxies": [
{
"path": "/v1",
"proxyUrl": "https://api.instagram.com/v1"
}
]

Run ionic serve, and then you remove this proxies variable, each time you try tu run ionic serve you get this error:

Uh oh! There's a syntax error in your ionic.config.json file: SyntaxError: Unexpected token } in JSON at position (line)

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.19
Node Version: v6.10.0
Xcode version: Not installed

insert the output from ionic info here

Copied from original issue: ionic-team/ionic-framework#10631

@jthoms1
Copy link
Contributor

jthoms1 commented Mar 6, 2017

It is very likely that you have left a trailing comma on the line above proxies. This makes the JSON invalid.

@jthoms1 jthoms1 added v2 and removed v2 labels Mar 6, 2017
@LeviZell
Copy link

LeviZell commented May 4, 2017

more info? I have the same problem:
Uh oh! There's a syntax error in your ionic.config.json file:
SyntaxError: Unexpected token  in JSON at position 0
at JSON.parse ()

@angular/cli: 1.0.2
node: 7.10.0
os: win32 x64
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/compiler-cli: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2
@angular/cli: 1.0.2

Heres my ionic.config.json info

{
"name": "myapp",
"app_id": "",
"v2": true,
"typescript": true
}

@limkokmeng
Copy link

limkokmeng commented May 31, 2017

Hello,
I am currently experiencing this too. Would be great if there is a solution for this soon.
After adding a proxy, I ran ionic serve and this error message starts persisting. It occurs even after I undo the changes.

Error:
Uh oh! There's a syntax error in your ionic.config.json file:
SyntaxError: Unexpected token  in JSON at position 0
at Object.parse (native)
...

ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.5
Xcode version: Not installed

ionic.config.json
{
"name": "NW",
"app_id": "",
"v2": true,
"typescript": true,
"proxies": [
{
"path": "/proxy",
"proxyUrl": "https://maps.googleapis.com/"
}
]
}

@imhoffd
Copy link
Contributor

imhoffd commented May 31, 2017

@zackxz This issue is old and we're not supporting CLI v2 anymore. If the problem persists when you upgrade your CLI, make a new issue.

@imhoffd imhoffd closed this as completed May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants