You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index.js currently has both import ... from ... statements and module.exports = ... syntaxes, which are two different import systems.
The current problem I'm facing is I'm trying to bundle a script importing @bjorn3/browser_wasi_shim with webpack, and it fails at buildtime when importing with require() (because @bjorn3/browser_wasi_shim's package.json has an exports field that says index.js is only importable via import statements) and fails at runtime when importing with import (because webpack throws an error if an ESM module tries to set module.exports)
index.js
currently has bothimport ... from ...
statements andmodule.exports = ...
syntaxes, which are two different import systems.The current problem I'm facing is I'm trying to bundle a script importing
@bjorn3/browser_wasi_shim
with webpack, and it fails at buildtime when importing withrequire()
(because@bjorn3/browser_wasi_shim
'spackage.json
has anexports
field that saysindex.js
is only importable viaimport
statements) and fails at runtime when importing withimport
(because webpack throws an error if an ESM module tries to setmodule.exports
)https://stackoverflow.com/a/42450109/4966649
Repro:
Expected clean exit, got
Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead
Less importantly, it would be great if
@bjorn3/browser_wasi_shim
could provide a UMD build so that it's easy to just do something likeFor now, I can just bundle the package myself with webpack.
The text was updated successfully, but these errors were encountered: