Create-react-app: Different Hash Names in AWS CodePipeline

Created on 1 Apr 2019  路  2Comments  路  Source: facebook/create-react-app

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

Environment Info: 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.

bug

Most helpful comment

Related: https://github.com/webpack/webpack/issues/8419.

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

All 2 comments

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

Related: https://github.com/webpack/webpack/issues/8419.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveLindberg picture DaveLindberg  路  3Comments

alleroux picture alleroux  路  3Comments

barcher picture barcher  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

wereHamster picture wereHamster  路  3Comments