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
can't access emitted filename if that file was emitted in a file that only exists in manualChunk #4746
Comments
Turns out the issue here is that we have separate handlers for emitted files between build and generate phase. The reason is that emitted files in one output should not be emitted in another output. So we have one central file-emission-handler during build, and when outputs are generated, all emitted files are copied over from the central handler to the output specific handler. Now the question is, what should the solution be? Unfortunately, Rollup does not know why a file was emitted. Maybe the file really is needed, who knows? My current ideas for a solution go into the direction of allowing to keep emitting files via Will follow up on this one. |
Fix at #4761 |
Thanks! I tested out that PR and worked as I expected. |
This issue has been resolved via #4761 as part of rollup@3.8.0. You can test it via |
Rollup Version
3.7.2
Operating System (or Browser)
stackblitz
Node Version (if applicable)
No response
Link To Reproduction
https://stackblitz.com/edit/rollup-template-9nc4ay?file=rollup.config.js
Expected Behaviour
I expect the filename can be obtained without an error happening.
This config is a weird one.
src/foo.js
is specified inmanualChunks
but cannot be referenced from the entrypoint (src/main.js
).I guess this is not intended to be possible. So alternatively, I expect the build fails with an error that tells
manualChunks
is incorrectly configured.(I couldn't give a well summarized title)
Actual Behaviour
The following error happens.
Could be related to #4744?
Original issue: vitejs/vite#11293
The text was updated successfully, but these errors were encountered: