When using pnpm instead of npm, my .d.ts declaration files don't work.
I'm using this .d.ts file:
to allow me to easily use CSS custom properties in
style={{}}
tags. I tried creating a new next.js project with pnpm (pnpm create next-app
) and adding this declaration at the root of the project and it doesn't work, the editor is reporting errors and my build fails.
If I move the project over to npm
(remove node modules, remove pnpm-lock.yaml, run npm i), it starts working and my build succeeds.
Any ideas?1 Reply
In case anyone finds this, the solution was installing
csstype
(pnpm add -D csstype
), because of how pnpm resolves dependencies versus npm.