react-clear-cache
react-clear-cache copied to clipboard
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
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.
I caught this on Sentry. Even though it received meta.json file it is still giving this error.
I caught this error on sentry as well as hotjar. Given solution is not working.