question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Unexpected token a in JSON at position 0

See original GitHub issue

Brand new installation using ant-design-pro-cli - nothing changed from install - any fixes?

index.js:2178 SyntaxError: Unexpected token a in JSON at position 0 at JSON.parse (<anonymous>) at getAuthority (authority.js:9) at Object../src/utils/Authorized.js (Authorized.js:4) at __webpack_require__ (bootstrap:772) at fn (bootstrap:130) at Object../src/models/login.js (login.js:6) at __webpack_require__ (bootstrap:772) at fn (bootstrap:130) at Object../src/pages/.umi/DvaContainer.js (DvaContainer.js:15) at __webpack_require__ (bootstrap:772) at fn (bootstrap:130) at render (umi.js:16) at umi.js:27

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
GithubGoldMinercommented, Sep 11, 2018

@scotty595 I just found that #2218 doesn’t have any English answer. So I will answer you here: This seems to be a LocalStorage issue, I fixed this issue by clearing the localStorage in my browser and everything will be able to work. 😃

0reactions
afc163commented, Sep 13, 2018

@chandlerq Changing antd-pro-role name may confuse some people, the code is still easy to understand IMO. 😀

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected token < in JSON at position 0
This happens when you are running backend and frontend on the same sever (e.g., localhost). To fix that, in the package.json inside your...
Read more >
What Is JSON and How to Handle an “Unexpected Token” Error
“Unexpected token < in JSON at position 0” is the error that I have seen most throughout my time of working as a...
Read more >
How to Fix SyntaxError: Unexpected token < in JSON at ...
Usually this error is caused when your server returns HTML (which typically begins with <DOCTYPE html> or <html> ) instead of JSON. Valid...
Read more >
Unexpected token in JSON at position 0 - Moodle.org
Re: Unexpected token in JSON at position 0 ... This usually means that an error has been returned and that's not valid JSON....
Read more >
How To Fix Unexpected token u in JSON at position 0 - Isotropic
The "Unexpected token u in JSON at position 0" is a typically Javascript error that will show up in your console log if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found