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

Same bundle hash for modified content across two builds #459

Closed
otbe opened this issue Jan 12, 2018 · 9 comments
Closed

Same bundle hash for modified content across two builds #459

otbe opened this issue Jan 12, 2018 · 9 comments
Labels

Comments

@otbe
Copy link

otbe commented Jan 12, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behaviour?
I get stable hashes for my bundle.js across multiple builds with modified files.

If the current behaviour is a bug, please provide the steps to reproduce.
Create a new project via preact-cli (default template) build it, add something in app.js and rebuild it.
Both artifact versions (bundle.js) get the same hash which breaks distributing via CDN.

What is the expected behaviour?
The second run should generate a different hash. I don’t tried the same thing with the style.css bundle. Maybe it’s the same thing.

Please mention other relevant information.

  • Node version 9.4
  • npm version bundled version
  • Operating system OSX
  • CLI version latest
  • Browser all

P.S.: besides this I’m in love with this cli. Everything works OOTB or can be added via plugin or a small configuration. Great work!

@prateekbh
Copy link
Member

@otbe what command/flags are you using to build the app?

@otbe
Copy link
Author

otbe commented Jan 12, 2018

Only the default ones. A simple preact build (or npm run build) leads to this error.

@prateekbh
Copy link
Member

preact-cli version?

@otbe
Copy link
Author

otbe commented Jan 12, 2018

2.1.0 (installed today :))

There is a test repo: https://github.com/otbe/preact-cli-test

$ npm i 
$ npm run build

Note the hash from bundle.[hash].js; go to app.js and add something after foo

$ npm run build

On my machine I get the same hashes for both builds. :/

@prateekbh
Copy link
Member

checking now

@prateekbh
Copy link
Member

wow this actually is a bug. how is this never caught before is amazing!
or may be i out of touch and missing something super obvious

@lukeed lukeed added the bug label Jan 12, 2018
@lukeed
Copy link
Member

lukeed commented Jan 12, 2018

Found the culprit: alexindigo/webpack-chunk-hash#15

@lukeed
Copy link
Member

lukeed commented Jan 12, 2018

Thanks for pointing this our @otbe! Looks like it was affecting my builds too. 👎 For auto-resolving semver dependencies, haha.

I'll try to send in a fix now.

@otbe
Copy link
Author

otbe commented Jan 13, 2018

Thanks for the fast fix! Works for me 👍

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

No branches or pull requests

3 participants