Uncaught SyntaxError: Unexpected token u in JSON at position 0
See original GitHub issuejson parse error while providing the following preloadedstate…
const store = createStoreWithMiddleware(reducers, load({
states: localstorageStates,
preloadedState: {
root: {
initial: true,
data: [],
prevSearchTerm: '',
searchTerm: '',
error: false,
hasMore: false,
loadedAll: false,
itemsPerPage: 25,
showProfile: false,
noSearchResult: false,
},
},
}));
i tried json stringify and parse with preloadedstate object and its working fine.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Unexpected token u in JSON at position 0 - Stack Overflow
Your app is attempting to parse the undefined JSON web token. Such malfunction may occur due to the wrong usage of ...
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 >Unexpected token u in JSON at position 0 Error in JS [Fixed]
The "SyntaxError: Unexpected token u in JSON at position 0" error occurs when we pass a value that is not valid JSON to...
Read more >Unexpected token u in JSON at position 0 in JavaScript
The "Unexpected token u in JSON at position 0" error in JavaScript is typically caused by trying to parse a string as JSON...
Read more >Troubleshoot 'Uncaught SyntaxError: Unexpected token u in ...
The 'Uncaught SyntaxError: Unexpected token u in JSON at position 0' error is caused when the client has been asked to execute JSON.parse() ......
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 Free
Top 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
I faced the same issue and got it resolved with your latest changes. Thanks!
Thanks for letting me know @romor