-
Notifications
You must be signed in to change notification settings - Fork 4
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
Cannot enqueue CSS and JS asset with the same handle #30
Comments
@johnbillion Sorry for the delay on this. Conversely to #27, I'd expect this to be the only way this would work as expected. Can you confirm that your issue here is describing a production build? It's a long shot, but in a development build no CSS file will be output and so the only enqueue would be the |
Whoops, I just figured this out – the issue was not that the handle is the same, it is that the handle is the same and the script entry point (bundle name) is different. They can either both be the same, or should both be different, but if one is the same and one is not that is where the issue was coming from. I've been trying to figure out whether there is a more sustainable way to fix this bug long term, but I haven't come up with anything that wouldn't add too much complexity so I think we're just gonna throw a warning in the future. |
In the WordPress world it's possible for a CSS dependency and a JS dependency to share the same handle. When using Asset Loader, this works fine for a production build but not when using webpack-dev-server during dev.
It appears that the latterly registered dependency gets skipped completely. In the example below, the
main.js
file gets enqueued but thestyle.css
file does not.May be related to #27
The text was updated successfully, but these errors were encountered: