-
Notifications
You must be signed in to change notification settings - Fork 57
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
Do not use .mjs extension for ES module files #419
Comments
@willopez I think if you do this and publish updated package, you will then be able to remove your other |
This is a major issue for me, as the two styled-components modules seem to be interfering with each other and they end up breaking either the reaction components style or the style of my "handmade" components. EDIT: I "fixed" it adding an alias for styled-components in webpack to force it to chose just one version of it. |
Would you mind sharing your solution for future troubleshooting @Kiailandi ? |
I added an alias for styled-components in my webpack config file forcing the choice on the one coming from the styled-components package itself.
EDIT: sorry about the format, I don't really understand why it removes the line breaks even if it's formatted as code. |
Type: minor
Describe the bug
When a Webpack app imports this package and
styled-components
, two copies of thestyled-components
code are bundled. See Webpack issue: webpack/webpack#9329Expected behavior
Only one copy of styled-components package should be bundled.
Solution
This still seems like something wrong in Webpack, but as discovered in the issue, the problem stems from the
.mjs
extension, which we need not use to provide ES modules. So the solution is to update this file in a few places to use.esm.js
instead of.mjs
as the extension.The text was updated successfully, but these errors were encountered: