Description
- Rollup Plugin Name: @rollup/plugin-commonjs
- Rollup Plugin Version: 22.0.2
- Rollup Version: 2.79.1
- Operating System (or Browser): Ubuntu, Chromium
- Node Version: v16.17.1
- Link to reproduction (
⚠️ read below): https://github.com/lucaelin/rollup-commonjs-bug
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