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
empty dynamic import breaks later code #3243
Comments
I understand, but the warning is technically correct, though the wording is wrong. It should read "created an empty chunk". If you do not throw for warnings, you will see that the entry chunk with the console.log is created. It is the dynamic chunk that is empty, which causes the warning. I think this should definitely be improved, if only to change the warning message in these cases. I guess it would also be helpful to include the name of the empty chunk in the warning message to make clear which chunk we are referring to. |
As for the warning itself, I think it still makes sense. Empty chunks will only be created in two cases: The target of a dynamic import does not have side-effects, or an entry chunk does not have side-effects. Both are under the user's control and are probably unintended. |
Ah 🤦♂ Makes sense. Sorry for the noise.
I opened a PR: #3244 |
How Do We Reproduce?
Expected Behavior
A non empty bundle is generated that contains the console.log
Actual Behavior
An empty bundle is created. The empty dynamic import seems to cause the issue. If you comment out the
console.log
in 'a.js', it works.The text was updated successfully, but these errors were encountered: