-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
index.mjs messes up default import #238
Comments
Sorry to hear about the issue @thany. As a workaround, can you configure your webpack config? |
Thanks, I'll give it a go after Easter. |
That did the trick! 😀 For future reference, I had to go for: resolve: {
// ...
mainFields: ['main', 'module'],
} Since in our case, it builds to a module for SSR purposes, instead of a regular thing that goes to the browser. Now, I do still wonder. Is this a solution or merely a workaround? I'm not sure if this still requires a proper solution, or if the above is the actual proper solution. |
So far, I haven't seen a lot issues regarding the |
Fair enough, then let's consider this a proper solution. |
@thany would you like to document this in the |
That might be helpful, yes. Good to close 👍🏻 |
Default export not found. This problem started existing since the
index.mjs
was added. When I delete or rename this file from the installed package, it builds fine. When I put it back, I get these warnings again.Maybe our webpack config is picking up
index.mjs
in favour ofindex.js
, but it shouldn't, since I'm explicitly telling it to only find.js
and.jsx
files in the babel-loader config.Last known working version is 1.1.2. I'll be downgrading for the time being, since downgrading feels like the most reliable thing to do until a proper fix becomes available.
Expected Behavior
Build OK, no warnings.
Actual Behavior
Warnings everywhere this package is being used:
Steps to Reproduce
Just import like this:
Workaround is to import like this:
Which works absolutely fine. But since the former notation is in the docs, I'm assuming that's how it's intended to be. Hence why the latter form is a workaround - not a solution.
Reproducible Demo
Sorry, it's a really complicated project, I'm not sure if I can do this. If it's really really really really neccesary, I can give it a go, but honestly, this problem is already costing me so much time 😞
Environment
The text was updated successfully, but these errors were encountered: