im getting this error "Uncaught SyntaxError: Unexpected token '<' " when using CRA development server. Usually clearing cache and reloading helps. How can i fix that? Link repo in which my problem occurs: https://github.com/MaciejWiatr/Cookup/tree/develop
-
Maybe it can help: <stackoverflow.com/questions/54340240/…>Stephani Knupp– Stephani Knupp2020-06-22 18:48:38 +00:00Commented Jun 22, 2020 at 18:48
-
Already tried this one and it didnt work :(Dettlaff– Dettlaff2020-06-22 19:01:34 +00:00Commented Jun 22, 2020 at 19:01
-
Can you provide a stack trace of the error?Keimeno– Keimeno2020-06-22 20:27:49 +00:00Commented Jun 22, 2020 at 20:27
Add a comment
|
1 Answer
Okay, it seems that I've figured it out. It was all serviceWorker's fault. I've added the following snippet and everything started working fine
if (!process.env.NODE_ENV || process.env.NODE_ENV === "development") {
// dev code
serviceWorker.unregister();
} else {
// production code
serviceWorker.register();
}