1

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

3
  • Maybe it can help: <stackoverflow.com/questions/54340240/…> Commented Jun 22, 2020 at 18:48
  • Already tried this one and it didnt work :( Commented Jun 22, 2020 at 19:01
  • Can you provide a stack trace of the error? Commented Jun 22, 2020 at 20:27

1 Answer 1

2

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();
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.