Skip to content

[@rollup/plugin-commonjs] does not provide an export named 'exports' #1306

Closed
@lucaelin

Description

@lucaelin

I recently took a deep dive into some issues related to the @web/dev-server in conjunction with the commonjs plugin. You can read up on those related issues here. One remaining issue is with this plugin and the above error message. The commonjs-plugin injects an import statement using this logic here, but the generated output here does not provide the expected export-signature.

Apparently rollup itself does not show the same issue, which makes me wonder what I am missing in my analysis and if this is actually a bug in this plugin or if the @web/dev-server is actually at fault here. Any input is greatly appreciated!

Expected Behavior

web-dev-server should be able to transpile individual modules and pass module and import resolution over to the browser

Actual Behavior

The browser shows an error message, because the export signature of the ?commonjs-module stub does not match the signature of the generated import. Namely an export named exports is missing.

Additional Information

see above

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