Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds are not reproducible when code splitting and CSS modules are used at the same time #8887

Closed
louischan-oursky opened this issue Mar 14, 2023 · 1 comment

Comments

@louischan-oursky
Copy link

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

No configuration is required to trigger this bug.

🤔 Expected Behavior

The build should be reproducible when code splitting and CSS modules are being used at the same time.
Reproducible means the hashes in the filenames should remain the same if nothing has been changed between the builds.

😯 Current Behavior

The build is NOT reproducible. The hashes in the filenames change every time I build, even nothing has been changed between the builds.

💁 Possible Solution

🔦 Context

I have a CI setup that builds a Docker image that contains parcel-built assets on every push to any branches. So the same commit hash could be built multiple time and then pushed to the registry. Since the build is not reproducible, the content of the Docker image changes even the tag (the git commit in this case) is the same. Thus pulling the Docker image at different time may actually fetch a different image.

In my deployment, I have several k8s pods running the image. If a node fails, a node is spawn. k8s will fetch the image again, which could be different in content with the same hash. So we now have two pods serving two different index.html. The requests to the pods are in a round-robin fashion. The final outcome is that many requests to assets will result in 404 because some assets is available in a pod but not in another.

💻 Code Sample

I made a code repository to repoduce this issue at https://github.com/louischan-oursky/parcel-bug-codesplit-css-modules

🌍 Your Environment

Software Version(s)
Parcel 2.8.3
Node 16
npm/Yarn npm
Operating System macOS 13.2.1
@mischnic
Copy link
Member

mischnic commented Mar 15, 2023

This is already fixed by #8817 in the nightly releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants