Skip to content

Problem with new builds #3574

Closed
Closed
@RohovDmytro

Description

@RohovDmytro

After each new build I have this error in production:

Uncaught SyntaxError: Unexpected token <

And I cannot understand the exact reasoning behind this. And this error disappers after couple of page refreshes.

More formaly

  • Making first build. Everything is fine.
  • Making second build. Having an error in console about problems with loading previous build.
  • Refreshing page. Refreshing page. Refreshing page. Everything is fine.

Conclusion

Somehow because of service worker chrome is loading previous js build. Thus server cannot serve it so I have a parsing error in console. After service worker updates now chrome is loading last build and everything is working fine.

Maybe, maybe service worker also cached index.html? Is t

Questions

What is messed up? How to force chrome load latest build after updates? Is it a good idea to cache index.html? (if that is true)

Info

  • Latest Chrome
  • Latest CRA
  • serving with simple express.js server

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions