typescript-plugin-css-modules icon indicating copy to clipboard operation
typescript-plugin-css-modules copied to clipboard

Error when using npm package that exports scss file

Open in-in opened this issue 9 months ago • 1 comments
trafficstars

Describe the bug When using an npm package that exports a scss file, an error occurs: "Property 'MenuEnter' does not exist on type '{}'"

To Reproduce Steps to reproduce the behavior:

  1. npm install bulma
  2. add module to scss file (menu) @use "bulma/sass/utilities/mixins";
  3. use it
.MenuEnter {
  background: red;

  @include mixins.from(1280px) {
    background: blue;
  }
}
  1. import styles into .ts file import styles from "./menu.module.scss";
  2. Try using this styles.MenuEnter
  3. See error "Property 'MenuEnter' does not exist on type '{}'"

Expected behavior No error messages

Screenshots Image

Desktop (please complete the following information):

  • OS: Linux Mint 22 Cinnamon
  • Browser Chromium
  • Version 133.0.6943.53 (Official Build) for Linux Mint (64-bit)

Smartphone (please complete the following information):

I haven't checked.

Additional context tsconfig.json

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "jsx": "react-jsx",
    "module": "esnext",
    "outDir": "${configDir}/dist",
    "moduleResolution": "bundler",
    "noEmitOnError": true,
    "plugins": [
      {
        "name": "typescript-plugin-css-modules",
        "options": {
          "goToDefinition": true
        }
      }
    ],
    "resolveJsonModule": true,
    "target": "esnext"
  },
  "exclude": ["node_modules", "${configDir}/dist"],
  "extends": ["@tsconfig/strictest/tsconfig"]
}

"typescript-plugin-css-modules": version "5.1.0"

bulma source: https://github.com/jgthms/bulma

in-in avatar Feb 18 '25 10:02 in-in

same issue

bugfix2020 avatar Mar 19 '25 11:03 bugfix2020

Any known workaround?

GendelfLugansk avatar Sep 09 '25 18:09 GendelfLugansk