vin's avatar
Level 6

MIX: chunk hash different across hosts

Hey,

Before i try and dig through the source code to try and find the answer i was hoping someone actually encountered this before.

Is there a reason why a chunk hash will be different on different hosts even though the files are identical? Does webpack takes takes the host into consideration when generating the hash?

For example, i have 2 hosts and a local machine.

local machine renders the following assets with hashes:

Host #1

 DONE  Compiled successfully in 34794ms                                                                                                                                                             18:50:53

                                                    Asset     Size  Chunks             Chunk Names
  /modules/xxx/build/js/vendor.401a936c6609ca7761d0.js   644 kB       0  [emitted]  /modules/xxx/build/js/vendor
     /modules/xxx/build/js/app.5d80e56f8de41cb3c06d.js   129 kB       1  [emitted]  /modules/xxx/build/js/app
/modules/xxx/build/js/manifest.d41d8cd98f00b204e980.js  1.53 kB       2  [emitted]  /modules/xxx/build/js/manifest
   /modules/xxx/build/css/app.fe8172acfbbd269ad09c.css   188 kB       1  [emitted]  /modules/xxx/build/js/app
                                        mix-manifest.json  8.99 kB          [emitted]

Host #2

 DONE  Compiled successfully in 30315ms                                                                                                                                                             18:46:37

                                                    Asset     Size  Chunks             Chunk Names
  /modules/xxx/build/js/vendor.66f69ae664021d570998.js   644 kB       0  [emitted]  /modules/xxx/build/js/vendor
     /modules/xxx/build/js/app.5d80e56f8de41cb3c06d.js   129 kB       1  [emitted]  /modules/xxx/build/js/app
/modules/xxx/build/js/manifest.d41d8cd98f00b204e980.js  1.53 kB       2  [emitted]  /modules/xxx/build/js/manifest
   /modules/xxx/build/css/app.06094a02b5c3deb891a0.css   188 kB       1  [emitted]  /modules/xxx/build/js/app
                                        mix-manifest.json  8.25 kB          [emitted]

Local Machine

 DONE  Compiled successfully in 15970ms                                                                                                                                                          10:56:07 AM

                                                    Asset     Size  Chunks             Chunk Names
  /modules/xxx/build/js/vendor.b9ac844e304190214769.js   644 kB       0  [emitted]  /modules/xxx/build/js/vendor
     /modules/xxx/build/js/app.8b19c5da092685c66a02.js   129 kB       1  [emitted]  /modules/xxx/build/js/app
/modules/xxx/build/js/manifest.d41d8cd98f00b204e980.js  1.53 kB       2  [emitted]  /modules/xxx/build/js/manifest
   /modules/xxx/build/css/app.d1db91514da0bcc35f1a.css   188 kB       1  [emitted]  /modules/xxx/build/js/app
                                        mix-manifest.json  5.58 kB          [emitted]

Essentially all 3 instances are the same in terms of file state. When running webpack to build for production the hashes are different for the chunk names.

There are suggestions of using 'webpack-md5-hash' but that also does not solve the issue.

Question is, Does webpack hash generated differs based on the host it is running?

Thank You.

0 likes
1 reply

Please or to participate in this conversation.