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

Types not compatible with moduleResolution Node16 #101

Open
privatenumber opened this issue Mar 24, 2023 · 0 comments · May be fixed by #118
Open

Types not compatible with moduleResolution Node16 #101

privatenumber opened this issue Mar 24, 2023 · 0 comments · May be fixed by #118

Comments

@privatenumber
Copy link

The export map specifies the types incorrectly:

colord/package.json

Lines 32 to 98 in 3f859e0

"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js",
"default": "./index.mjs"
},
"./plugins/a11y": {
"types": "./plugins/a11y.d.ts",
"import": "./plugins/a11y.mjs",
"require": "./plugins/a11y.js",
"default": "./plugins/a11y.mjs"
},
"./plugins/cmyk": {
"types": "./plugins/cmyk.d.ts",
"import": "./plugins/cmyk.mjs",
"require": "./plugins/cmyk.js",
"default": "./plugins/cmyk.mjs"
},
"./plugins/harmonies": {
"types": "./plugins/harmonies.d.ts",
"import": "./plugins/harmonies.mjs",
"require": "./plugins/harmonies.js",
"default": "./plugins/harmonies.mjs"
},
"./plugins/hwb": {
"types": "./plugins/hwb.d.ts",
"import": "./plugins/hwb.mjs",
"require": "./plugins/hwb.js",
"default": "./plugins/hwb.mjs"
},
"./plugins/lab": {
"types": "./plugins/lab.d.ts",
"import": "./plugins/lab.mjs",
"require": "./plugins/lab.js",
"default": "./plugins/lab.mjs"
},
"./plugins/lch": {
"types": "./plugins/lch.d.ts",
"import": "./plugins/lch.mjs",
"require": "./plugins/lch.js",
"default": "./plugins/lch.mjs"
},
"./plugins/minify": {
"types": "./plugins/minify.d.ts",
"import": "./plugins/minify.mjs",
"require": "./plugins/minify.js",
"default": "./plugins/minify.mjs"
},
"./plugins/mix": {
"types": "./plugins/mix.d.ts",
"import": "./plugins/mix.mjs",
"require": "./plugins/mix.js",
"default": "./plugins/mix.mjs"
},
"./plugins/names": {
"types": "./plugins/names.d.ts",
"import": "./plugins/names.mjs",
"require": "./plugins/names.js",
"default": "./plugins/names.mjs"
},
"./plugins/xyz": {
"types": "./plugins/xyz.d.ts",
"import": "./plugins/xyz.mjs",
"require": "./plugins/xyz.js",
"default": "./plugins/xyz.mjs"
},

You can verify that it's not working by setting compilerOptions.moduleResolution to Node16.

It should look closer to:

    "exports": {
        "require": {
            "types": "./dist/index.d.cts",
            "default": "./dist/index.cjs"
        },
        "import": {
            "types": "./dist/index.d.mts",
            "default": "./dist/index.mjs"
        }
    },

Detailed explanation here: microsoft/TypeScript#50067

@bigtimebuddy bigtimebuddy linked a pull request Oct 2, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant