Skip to content
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

Can’t import react from node_modules #1227

Closed
mbostock opened this issue Apr 12, 2024 · 1 comment
Closed

Can’t import react from node_modules #1227

mbostock opened this issue Apr 12, 2024 · 1 comment
Assignees
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

The problem is two-fold. First, esbuild doesn’t allow importing CommonJS in our current configuration:

[plugin esbuild] node_modules/react/index.js: ▲ [WARNING] Converting "require" to "esm" is currently not supported [unsupported-require-call]

Second, if you use the commonjs rollup plugin, the module.exports gets erroneously turned into the default export instead of using named exports.

I have to admit I’ve forgotten why we’re using both esbuild as a rollup plugin, instead of either using rollup by itself, or using esbuild by itself. 😕

@mbostock mbostock added the bug Something isn’t working label Apr 12, 2024
@mbostock mbostock self-assigned this Apr 12, 2024
@mbostock
Copy link
Member Author

Fixed in #1229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

1 participant