Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we finally have ESM and default export working well? (SWC related behaviour) #6

Open
kyr0 opened this issue May 1, 2024 · 0 comments

Comments

@kyr0
Copy link

kyr0 commented May 1, 2024

$ node --enable-source-maps --import @swc-node/register/esm-register ./scripts/foo.ts

./scripts/foo.ts:

// import and use any package with a peer dependency to boolbase
node_modules/css-select/lib/esm/attributes.js:1
import boolbase from "boolbase";
       ^^^^^^^^
SyntaxError: The requested module 'boolbase' does not provide an export named 'default'

Well, this is an error you can hardly recover from. You cannot use any library anymore that has a peer dependency down the road that is somewhere using boolbase.

node -v
v20.11.1

packages used:
    "@swc/core": "^1.4.17",
    "@swc-node/register": "^1.8.0",
@kyr0 kyr0 changed the title Can we finally have ESM working well? Can we finally have ESM and default export working well? (SWC related behaviour) May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant