Skip to content

Wrong main.js file is tried to download after a deploy (CRA + S3 + Cloudfront) #4319

Closed
@segulino

Description

@segulino

Is this a bug report?

I think that yes, maybe related to service worker func.

Did you try recovering your dependencies?

It isn't related with this.

Environment

Node version: v8.11.1
Yarn version: v1.2.1
Hosted on Amazon S3 + Cloudfront

Steps to Reproduce

  1. Build app using "react-scripts build", a new main.yyyy.js is generated.
  2. Sync to aws s3 bucket
  3. Invalidate cloudfront cache
  4. Try access to webapp url.
  5. The magic occurs:

image

The browser try to get old main.xxxxx.js generating an 404 not found error (user see a white screen), if you reload the browser web app is loaded rightly.

Expected Behavior

After a deploy with the steps mentioned, when we try to access web app url this should get the new main.js file, avoiding the first white screen.

I've reviewed this issue: #3688 that is exactly the same problem, but i've not found a solution for this.

It's very important for us, thanks in advance for your help.

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