-
Notifications
You must be signed in to change notification settings - Fork 790
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
"p-*"-files are not immutable. Hash-filename doesn't update when content changes. #2526
Comments
Update: It looks like Vite has made a workaround for the Rollup issue, maybe this could be implemented in Stencil as well? |
Hey @mikkelrom - I tagged this so Ryan can confirm this bug and go from there. |
Thank you @splitinfinities, sounds great 🙌 🙂 |
Hi, is there an update on this? I'm running into the same issue. Basically, my build produces my-library.js and a bunch of p-.system.js . When I deploy this, everything works fine. |
I even tried setting the hashedFileNameLength to 12, and some files stay at 8 and some at 12. |
@splitinfinities @rwaskiewicz any update on this? 🙂 |
This seems like a potentially huge foundational issue for Stencil (and Ionic) and it is a little shocking to see so little official response for something that has been lingering since being reported in 2019. I know you guys are busy and it is annoying to get lots of issues and feature requests so it is easy for things to get lost in the list. But this one seems important. If you can not reproduce the problem, don't think it is a bug, are waiting on some other fix, have a suggested workaround, or even just agree that this is an important thing to fix that would be great to know. There are cases where getting the wrong version of a file can have a minor impact (like stale content) but there are also cases where the wrong version of a file can totally break an application. For example, missing import files break If it would be helpful for me to provide any more details about the downstream impact of non-immutable files then let me know and I can provide more detail. It is similar to if |
hey @mikkelrom - I took the liberty of taking your reproduction repo for a spin, but could not recreate the issue using the steps described: Further to this, I created a sandbox which isolates the snippet stencil is using under the hood for file hashes here and stencil seems to be consistent... Since the file hashing is done by node's internal 'crypto' module, it could boil down to the version of node used? ... I realise I'm just grasping |
Hi @johnjenkins. As mentioned, I'm pretty convinced that the issue is caused by Rollup. Please see here: https://bundlers.tooling.report/hashing/asset-cascade/ and here: rollup/rollup#3415 And as I mentioned in the first comment:
|
It's not clear to me how https://bundlers.tooling.report/hashing/asset-cascade/ is relevant because in this instance it's the actual 'core' file who's source is changing, not an imported asset. And I also don't think it's to do with rollup because rollup actually doesn't control the file hashing - that step happens after the rollup bundle, (it happens here < using 'rollupResults' above) just before the files are written to disk. Interestingly the vite fix you note here So I suppose it comes down to local environment. Also, have you tried |
Hi again @johnjenkins, sorry for the late reply. This issue was created a long time ago, so I decided to try and update the reproduction repo to the latest version of Stencil, as you suggested (from v1.12.2 to v2.13.0). And after updating I can't seem to reproduce the issue, which is really great! 🎉 The filename seem to change when the contents of the file is changed, which is great 🙂 I'm curious to know if this issue is also solved for others, just by using latest Stencil version? @janarvaez @cjorasch ? |
Hi! I'm afraid I had recently upgraded at the time of my comment, which was |
Hi @johnjenkins (cc @mikkelrom ) Here is a reproduction repo which can hopefully help: https://github.com/janarvaez/stencil-build-issue I left what I did in the README.md |
Hi All! Just updated my project to stencil 2.14.0 and issue still there.
|
to be clear, @bzolotukhyn @cjorasch @janarvaez is the issue primarily with the |
@johnjenkins I compared the last 5 builds of my library and in my case only one file (the same) doesn't change name when content changes and yes it's .system.js file. |
Update: Rollup issue fixed in v3.0.0. |
Excellent - we're scheduling Rollup-related updates starting next sprint. |
@rwaskiewicz any update on this and process on how to integrate it with existing stencil project? |
Hey @durgaprasad95, just a quick update: we'll be sure to ping here when we have a pre-release version of Stencil with Rollup v3 to test and confirm that this issue is addressed. Unfortunately upgrading Rollup in Stencil is quite involved because Stencil integrates very closely with Rollup, uses a lot of custom plugins, and so on. Because we're currently using a fairly outdated version we have to do something of a stepwise upgrade to eventually get up to v3. All that is to say that while we can't make a promise as to a specific timeline at present, the team is working on it and it is a priority for us. |
@alicewriteswrongs is there any update on this issue? |
Hi @alicewriteswrongs and @rwaskiewicz Thanks for being an active participant in the StencilJS. Wondering if there are any updates for this issue? |
Hey folks, we don't have any updates on this at this time. We put the rollup changes on hold for a few months, and will plan on picking them up again before the end of this year |
Thank you for the update @rwaskiewicz - much appreciated. |
I came up with a workaround, in case it helps anybody: to include a build timestamp prop in all components, which forces StencilJS to re-generate all files as the content always changes with every production build. Not ideal, but given the fact that the issue has been open for 4 years I don't expect any updates on it soon. As an idea to solve the issue in the core, instead of going down the rabbit hole of upgrading Rollup: this could be easily solved if StencilJS offered a method to pass a "?v" query string to the lazy-loader, in the same way that we set the setNonce() when loading the components. That way we ensure that all lazy-loaded files are appended with a version string on the URL, which will ensure the CDN always fetches the requested version of the file. |
Insufficient rollup version: "@rollup/plugin-commonjs" requires at least rollup@2.68.0 but found rollup@2.56.3. (plugin: commonjs, buildStart) i am getting this issue
|
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Stencil-config setting:
hashFileNames
not working entirely as expected.p-*
-files are not immutable even though they should be, since the content within can change without the filename itself changes.Expected behavior:
p-*
-filenames should change if the content within changes, so those files can be "forever-cached", which they cannot at the moment even though the docs says:Steps to reproduce:
https://github.com/mikkelrom/stencil-caching-issue
Other information:
Related issue: #1983
Information about rollup issue
The team behind http://web.dev created this to keep track of bundlers and their errors. This failing test in Rollup seems to maybe be causing this issue: https://bundlers.tooling.report/hashing/asset-cascade/
Rollup issue: rollup/rollup#3415
The text was updated successfully, but these errors were encountered: