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

Hashes aren't correctly invalidated when running Rollup in watch mode #2435

Closed
Rich-Harris opened this issue Aug 31, 2018 · 6 comments · Fixed by #2596
Closed

Hashes aren't correctly invalidated when running Rollup in watch mode #2435

Rich-Harris opened this issue Aug 31, 2018 · 6 comments · Fixed by #2596

Comments

@Rich-Harris
Copy link
Contributor

  • Rollup Version: 0.65
  • Operating System (or Browser): Mac OS
  • Node Version: 10.9

How Do We Reproduce?

https://github.com/Rich-Harris/rollup-watch-hash-bug

Expected Behavior

Changing the content of a file invalidates the hash of the chunk that contains it. It should also invalidate the hashes of any chunks that depend on that chunk.

Actual Behavior

It doesn't. The dependants' hashes stay the same, even though their content has changed to reflect the new import.

@nsivertsen
Copy link

nsivertsen commented Nov 22, 2018

I'm seeing what appears to be the same bug, in a Sapper application. The only difference is that for me this is not limited to watch mode, but also happens with normal builds.

Here's an example. The left box shows the JS assets loaded by the site before making changes to [slug].html and also after making the changes, while the browser still has the assets cached. The right bow shows the assets loaded after clearing the cache. Note that the only filename that changes is that of [slug].xxxxx.js, which is imported by client.xxxxx.js:

cache

@nsivertsen
Copy link

I just tested this against master (15e0885) because there were some changes to how chunking is done, but it is unfortunately still a problem.

@Rich-Harris's repro doesn't just apply to watch mode, dist/main.67c2222f.js also incorrectly keeps the same hash after changing foo.js when Rollup is run with npm run build.

@lukastaegert
Copy link
Member

Ah I see. This issue is that static dependencies are taken into account when calculating hashes while dynamic dependencies are ignored. I might be able to sneak something into the next release as it would be nice to have this working for 1.0.

@nsivertsen
Copy link

Thank you, that would be fantastic!

@lukastaegert
Copy link
Member

Fix at #2596, should be part of the next release

@nsivertsen
Copy link

That was quick! Thanks so much, Lukas.

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

Successfully merging a pull request may close this issue.

3 participants