react-clear-cache icon indicating copy to clipboard operation
react-clear-cache copied to clipboard

Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Open DefCon-018 opened this issue 3 years ago • 3 comments

DefCon-018 avatar Apr 14 '22 10:04 DefCon-018

This happens when you receive a document that is not a json file, for example; if no meta.json file was found, and your react app's response is to send a 404-page to any request to a resource that doesn't exist, you would encounter this.

I personally encountered this only when doing local debugging on localhost, so my solution was add a meta.json file with an empty version string in the /public directory. This file will be overwritten by the prebuild command anyway, so it doesn't matter that is empty.

adamelfstrom avatar Oct 27 '22 09:10 adamelfstrom

I caught this on Sentry. Even though it received meta.json file it is still giving this error.

sbimochan avatar Nov 02 '22 09:11 sbimochan

I caught this error on sentry as well as hotjar. Given solution is not working.

tejaswitandel avatar Mar 04 '23 08:03 tejaswitandel