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

Different Hash Names in AWS CodePipeline #6737

Open
whatadewitt opened this issue Apr 1, 2019 · 3 comments
Open

Different Hash Names in AWS CodePipeline #6737

whatadewitt opened this issue Apr 1, 2019 · 3 comments

Comments

@whatadewitt
Copy link

whatadewitt commented Apr 1, 2019

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Deployment, static files, hosting

Environment

 System:
 OS: Linux 4.14 Ubuntu 14.04.5 LTS, Trusty Tahr
 CPU: x64 Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
 Binaries:
 Node: 10.14.0 - /usr/bin/node
 npm: 6.4.1 - /usr/bin/npm
 npmPackages:
 react: 16.8.4 => 16.8.4
 react-dom: 16.8.4 => 16.8.4
 react-scripts: 2.1.8 => 2.1.8
 npmGlobalPackages:
 create-react-app: Not Found

Steps to Reproduce

  1. Make changes to my CRA App
  2. Commit those changes to github
  3. Codepipeline sees changes and kicks off the build process in 2 different regions (us-east-1 and us-east-2)

Expected Behavior

Based on the docs, I would expect the "contenthash" values on both of my builds to be the same for my main.js, main.css and chunk.js files.

Actual Behavior

On the 2 different boxes, my app builds successfully, but the hashnames are totally different.

I know this is happening because CodePipeline is bringing my code into a directory that they are creating dynamically. The "hash" is based on the directory that the code is built in.

Reproducible Demo

Clone the CRA base into a local working directory (./cra1 as an example).
Clone it again into another local working directory (./cra2 as an example).

Run npm run build on both folders.

Note the "compiled" filenames are different but their content is the same.

@whatadewitt whatadewitt changed the title Hash Names in AWS CodePipeline Different Hash Names in AWS CodePipeline Apr 1, 2019
@heyimalex
Copy link
Contributor

heyimalex commented Apr 1, 2019

Reproduced just like you said; renaming the directory causes the hashes to change.

@ianschmitz
Copy link
Contributor

Related: webpack/webpack#8419.

Sounds like they are reworking their hashing system for webpack 5.0 that could possibly fix this.

@iansu
Copy link
Contributor

iansu commented Jun 30, 2021

It looks like this has been fixed in webpack 5. We're currently working on upgrading to webpack 5 so this will be fixed then. See #9994.

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

No branches or pull requests

4 participants