Skip to content

Can’t import react from node_modules #1227

Closed
@mbostock

Description

@mbostock

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. 😕

Metadata

Metadata

Assignees

Labels

bugSomething isn’t working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions