SyntaxError: Unexpected token a in JSON at position 0
See original GitHub issueBrand 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:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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. 😃
@chandlerq Changing
antd-pro-role
name may confuse some people, the code is still easy to understand IMO. 😀