question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manifest hash won't change!

See original GitHub issue
  • Laravel Mix Version: 0.10.0
  • Node Version: v7.7.3
  • NPM Version: 4.1.2
  • OS: 10.12.4

Description:

manifes.js hash won’t change even app or vendor names had changed. If manifest is in browsers cache it will load the old app and vendor files.

Steps To Reproduce:

npm run production

<script src="/js/manifest.d41d8cd98f00b204e980.js"></script>
<script src="/js/vendor.0644ae2bcbd1e2178134.js"></script>
<script src="/js/app.d3d968be03d7943f18be.js"></script>
<script type="text/javascript" src="/js/home.40299b3f79c3bf7007fc.js"></script>

change something in app js files npm run production

<script src="/js/manifest.d41d8cd98f00b204e980.js"></script>
<script src="/js/vendor.0644ae2bcbd1e2178134.js"></script>
<script src="/js/app.4b2f4c54fb528e83e8f0.js"></script>
<script type="text/javascript" src="/js/home.40299b3f79c3bf7007fc.js"></script>

As you can see, app change from /js/app.d3d968be03d7943f18be.js to /js/app.4b2f4c54fb528e83e8f0.js but manifest is the same: /js/manifest.d41d8cd98f00b204e980.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
nicolasbeauvaiscommented, Apr 26, 2017

This is a “bug” in webpack-chunk-hash (forked from webpack-md5-hash which had the same bug), you can find a lot of official webpack example that show a manifest.d41d8cd98f00b204e980.jsfile.

see some related issue: https://github.com/alexindigo/webpack-chunk-hash/issues/7 https://github.com/erm0l0v/webpack-md5-hash/issues/9

I could trash fix it in my webpack.mix.js file by disabling the webpack-chunk-hash plugin, this rollback to the default webpack versioning which is able to generate a correct hash for the manifest file:

const { mix } = require('laravel-mix');

let WebpackChunkHash = function () {};
WebpackChunkHash.prototype.apply = () => {};
// Replace WebpackChunkHashPlugin with an empty function
mix.plugins.WebpackChunkHashPlugin = WebpackChunkHash;
1reaction
JPurinshcommented, Apr 30, 2020

This is how we solved this issue in our apps. After every mix recompile, we update mix-manifest.json with random integers at the end of the file.


.version()
.then((stats) => {

  // We're appending random int to the versioned files to guarantee
  // that all assets are fully re-cached on every new version (md5 sucks at this)

  let file = File.find(stats.compilation.options.output.path + '/mix-manifest.json');
  let assets = JSON.parse(file.read());

  let new_assets = {};
  Object.keys(assets).forEach(function (item) {
    let addedTimestamp = '-' + Date.now();
    new_assets[item] = assets[item] + addedTimestamp;
  });

  file.write(JSON.stringify(new_assets, null, 2));
})

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manifest hash won't change! · Issue #665 - GitHub
In my case, I can change my files and the manifest hash stays the same but the content changes. My webpack.mix.js file: let...
Read more >
Changing hash value doesnt work - Stack Overflow
If something's offline, I want to change the value to offline. I tried the following code: $::hash[somekey][online] = false. but that doesn't ...
Read more >
Troubleshooting "File [Filename], has a different computed ...
A common cause of this issue is that you changed the contents but the manifest doesn't update. You need to regenerate the manifest....
Read more >
Reasons Your Checksum Doesn't Match the Original
This is why we recommend troubleshooting steps for when checksums don't match. Whether you've downloaded a file, or need a helpful link for ......
Read more >
The Asset Pipeline - Ruby on Rails Guides
1 What is the Asset Pipeline? The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found