-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Attempted import error: 'randexp' does not contain a default export (imported as 'i'). #7962
Comments
@w0rmr1d3r I'm running a project with |
Hi @tim-lai ! I can't share the project, since it's company internal. But I might be able to provide more info regarding the build tool. What information may you need for it? thanks |
@w0rmr1d3r Any platform/environment details would be helpful. e.g. there are recent closed issues related to recent bundling changes where the users were using Typescript. Thanks. |
Hi @tim-lai I'm using React with version Using these engines: "engines": {
"node": "^16.13.0",
"npm": "^8.1.0"
}, Importing the library like so: import SwaggerUI from 'swagger-ui-react'; Thought this was related to this, #7970 , upgraded to 4.10.3 but it reported the same failure. I'm not an expert on this subject, found this post: This project is using randexp in
Which is a project that hasn't been updated in 4 years, is it possible to use another one instead? A newer one? Thanks in advance! |
Hi guys, I haven't been able to reproduce this. If I run following code in Node.js engine: import * as i from "randexp"; // i.default === RandExp
import RandExp from "randexp"; We're getting correct results. @w0rmr1d3r without providing more information, this issue will not be actionable. Could you please create a public GitHub repo with minimal steps to reproduce this problem? webpack@5 handles it also well. I assume that the problem is somehow caused by your build system which has limited interoperability between ESM and CommonJS. But again without the GitHub repo with minal steps to reproduce, we cannot help more. |
Hello @char0n , Since I can't share the entire repo because it's private and sharing a part of it wouldn't match the scenario, I'd rather look into it privately. Thank you again for your information. I will pass this issue to our teams 😄 |
Hello @char0n , Managed to solve the issue.
And was able to bump from The Cheers! |
Q&A (please complete the following information)
Content & configuration
File
package.json
:Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
4.1.2
to4.10.0
npm run build
Expected behaviour
Able to run the command.
Screenshots
Additional context or thoughts
The text was updated successfully, but these errors were encountered: