Skip to content

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

@kyr0

Description

@kyr0
$ 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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions