Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

fix(package.json): Add 'types/*' to package exports#1115

Open
jeffberry wants to merge 1 commit into
stitchesjs:canaryfrom
jeffberry:canary
Open

fix(package.json): Add 'types/*' to package exports#1115
jeffberry wants to merge 1 commit into
stitchesjs:canaryfrom
jeffberry:canary

Conversation

@jeffberry

Copy link
Copy Markdown

This fixes an issue that we are experiencing when setting moduleResolution in our tsconfig to NodeNext. When this is enabled, the module resolution will only allow importing from paths that are defined within the exports config. Because only types/index.d.ts is available for import, it is causing these kinds of embedded imports to fail:

import("@stitches/react/types/css-util").CSS

I think the alternative would be to ensure that all types are exported from the types/index.d.ts file.

@Achaak

Achaak commented Nov 30, 2022

Copy link
Copy Markdown

I confirm this need on my side to pass a lib in ESM and pass the moduleResolution in Node16

@yovanoc

yovanoc commented Dec 1, 2022

Copy link
Copy Markdown

Please accept this PR

@smol-honk

Copy link
Copy Markdown

@peduarte who should we @ to get this looked at? Thank you again for your time! Love the library.

@jonathantneal

Copy link
Copy Markdown
Contributor

This actually looks really good. If I can get some access, I could merge this and put it into a release.

@peduarte

peduarte commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

cc @hadihallak @StephenHaney

@fmal

fmal commented Oct 20, 2023

Copy link
Copy Markdown
Contributor

@hadihallak @StephenHaney could you please merge this in and put it into a canary release or give @jonathantneal access do do so? This doesn't seem like much effort and would unblock usage of stitches with TypeScript's moduleResolution other than node. I would really appreciate it ☮️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants