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

Broken type annotations (missing @types/node and postcss-modules in dependencies) #183

Open
allisonkarlitskaya opened this issue Jul 3, 2024 · 0 comments

Comments

@allisonkarlitskaya
Copy link

When running tsc on our project, I get the following errors:

node_modules/esbuild-sass-plugin/lib/utils.d.ts:3:34 - error TS2307: Cannot find module 'postcss-modules' or its corresponding type declarations.

3 import PostcssModulesPlugin from 'postcss-modules';
                                   ~~~~~~~~~~~~~~~~~

node_modules/sass/types/legacy/render.d.ts:26:8 - error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

26   css: Buffer;
          ~~~~~~

node_modules/sass/types/legacy/render.d.ts:56:9 - error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

56   map?: Buffer;
           ~~~~~~

Those go away if I npm i @types/node postcss-modules.

Both of those are included in the devDependencies of esbuild-sass-plugin, but since they are referred to from public type declaration files shipped with the package, they need to be moved to dependencies.

The alternative would be to avoid those being mentioned in the relevant .d.ts files.

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