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.

Uncaught SyntaxError: Unexpected token u in JSON at position 0

See original GitHub issue

json 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:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
romorcommented, Feb 17, 2019

I faced the same issue and got it resolved with your latest changes. Thanks!

0reactions
kilkellycommented, Feb 17, 2019

Thanks for letting me know @romor

Read more comments on GitHub >

github_iconTop 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 >

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