nucab / react-clear-cache

MIT License
67 stars 49 forks source link

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

Open DefCon-018 opened 2 years ago

adamelfstrom commented 2 years ago

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.

sbimochan commented 2 years ago

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

tejaswitandel commented 1 year ago

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