-
Notifications
You must be signed in to change notification settings - Fork 103
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
esbuild chunking solution breaks after commit 3903815 #111
Comments
After 3903815: |
Thanks for the report. I have a large app running esbuild and propshaft, so I’ll apply chunking to it and see what I can do to fix this. |
@weilandia I can't seem to replicate the problem. I've created a demo app and configured it for esbuild, chunknames, and a lazy import (file named Do you have a demo app showing the problem? If not, could you take a look at mine and indicated what I'm missing when trying to replicate? |
I can't recreate the issue with your app. If you add something like the below, you'll see the dynamic chunk file being added, but still no issue.
Our app results in 76 of these |
Closing this because we decided not to do chunking with esbuild, though I do think there is a hard to reproduce issue when using propshaft with esbuild chunking on large apps (after 3903815). |
also running into this issue. @weilandia were you using anything like propshaft/lib/propshaft/server.rb Line 11 in 3903815
|
@brenogazzola - the "issue" is that esbuild creates many files named @weilandia - You can work around this by ensuring unique chunk names by including the hash in the "logical" part of the file name too:
|
I'm reviewing the esbuild docs and it seems there's no option to name the chunk anything other than @rainerborene Any thoughts on this? Is there another way we can get propshaft to ensure the preloads still work without breaking esbuild chunks, which always have the same name? |
@brenogazzola, while not ideal - you can get esbuild to output unique chunks if you include the hash twice #111 (comment)
I am testing propshaft (main branch & digested assets) & esbuild on a rails 7 upgrade and I have chunks loading, source maps loading (#117) - I have not yet got around to testing when esbuild updates a file and gets a new hash - whereby you have more than one "digested" file and propshaft should find the latest version |
Dealing with this after the 0.7.0 release. firien's fix works, but given that chunks/[name]-[hash] is the standard example in the esbuild docs, I expect a fair number of people are going to end up here, wondering what happened. If there's no good way to fix this in propshaft, I'd say it would be worth documenting the above fix (and maybe printing a warning when the gem is updated). |
#100 3903815 breaks chunking with esbuild when implemented as suggested here: #48
The reason is likely do the the fact that esbuild creates static chunks that do not have names, i.e. chunk-123, chunk-456, etc.
This is discussed here: evanw/esbuild#1716
The text was updated successfully, but these errors were encountered: