Skip to content

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

@allisonkarlitskaya

Description

@allisonkarlitskaya

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.

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