question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What i am doing wrong?

See original GitHub issue

Hi, i trying to use this plugin but i have some problems.

In my React project with js/ts/jsx/tsx files bundled by webpack with ts-loader i have error message in typescript log (in VS Code) and i do not have autocomplete for scss module default import properties.

I have installed plugin like this:

yarn add -D typescript-plugin-css-modules

my tsconfig.json looks like this:

{
  "compilerOptions": {
      "outDir": "./build",
      "allowJs": true,
      "jsx": "react",
      "module": "commonjs",
      "target": "es6",
      "esModuleInterop": true,
      "plugins": [
        {
          "name": "typescript-plugin-css-modules",
          "options": {
            "customMatcher": "\\.scss$"
          }
        }
      ]
  },
  "include": [
      "./src/**/*",
      "module.d.ts"
  ]
}

I added module.d.ts file to root directory of my project with this content:

declare module '*.scss' {
  const classes: { [key: string]: string };
  export default classes;
}

But in tsx popup with info about imported classes looks like this: image

In TS Server Log in VS Code i have this error:

Info 27   [13:26:55.840] Failed to load module 'typescript-plugin-css-modules' from /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/node_modules: Error: Could not resolve JS module 'typescript-plugin-css-modules' starting at '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/node_modules'. Looked in: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript-plugin-css-modules/package.json...

in my project i have these dev dependencies:

"ts-loader": "^8.0.1",
"typescript": "^3.9.7",
"typescript-plugin-css-modules": "^2.4.0",

what am I doing wrong?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
JonathanLorimercommented, Sep 17, 2020

@mrmckeb I am not sure if this helps, commenting for posterity, or anyone else who comes across this issue.

Upgrading the library, deleting node_modules, re-installing, re-starting vscode seemed to fix this issue!

Thank you.

2reactions
krutoocommented, Jul 21, 2020

it looks like the option is just not being output in command palette when file is not have .js/.ts extension, i found its option and its fully worked for me

i think issue can be closed

Read more comments on GitHub >

github_iconTop Results From Across the Web

I feel stuck in life, what am I doing wrong? - Quora
The only thing you are doing wrong is if you are not putting any effort for coming out. We all get stuck and...
Read more >
Ep #142: Finding the Answer: What Am I Doing Wrong?
Discover how to answer the question, “What am I doing wrong?” and do so with the intention of self-healing instead of self-loathing.
Read more >
Clasio & Rosenfeld – What Am I Doing Wrong? Lyrics - Genius
What Am I Doing Wrong? Lyrics: I need your touch / And I will show you / Just one's enough / Our bodies...
Read more >
What am I doing wrong? : r/socialskills - Reddit
What am I doing wrong? Hello everybody. First, I just wanted to say 'hi' to ...
Read more >
What Am I Doing Wrong? Lyrics - Clasio & Rosenfeld - AZLyrics
"What Am I Doing Wrong?" I need your touch. And I will show you. Just one's enough. Our bodies flowing. Now, but no....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found