Skip to content

[commonjs] "default" is not exported by some node core modules with strictRequires: 'auto' #1929

@danielroe

Description

@danielroe

Expected Behavior

With this config:

commonjs({
  strictRequires: 'auto',
}),

we now have an error when importing default export of some node core modules:

new (require('node:stream').Readable)({});
// throws RollupError: "default" is not exported by "node:stream?commonjs-external"

This worked fine with v28.0.6

Additional Information

This is code from @vue/server-renderer, which means that we spotted the issue in a renovate PR upgrade for Nuxt: nuxt/nuxt#33469.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions