react-ts-css icon indicating copy to clipboard operation
react-ts-css copied to clipboard

Module Not found 'pages/giftshop/giftshop.module.scss'React TS CSS

Open danielkoller opened this issue 2 years ago • 11 comments

Describe the bug Every styles import throws an error. It says that the module is not found although it is there and the styling is applied. The settings of your extension are default.

To Reproduce Steps to reproduce the behavior: As soon as a file is opened, the import shows an error. Running yarn, restarting the server or reloading the developer window doesn't help.

Expected behavior There should not be an error, because the file is there.

Screenshots Bildschirmfoto 2023-09-25 um 11 14 30 Bildschirmfoto 2023-09-25 um 11 14 52

Desktop (please complete the following information):

  • OS: macOS
  • Version 13.5.2

Additional context Running the latest version of React CSS Modules and played around with older versions - didn't help unfortunately. Thanks for the great extension nonetheless!

danielkoller avatar Sep 25 '23 09:09 danielkoller

@danielkoller Thanks for reporting this issue. I apologise for the frustration. This issue could have been a regression since #97 went live. Until I find time to fix this one you could toggle the diagnostics setting off to help you from these annoying red markers

Viijay-Kr avatar Sep 27 '23 10:09 Viijay-Kr

@Viijay-Kr thank you for your reply and the great plugin. I will toggle the diagnostics off for now.

danielkoller avatar Sep 27 '23 18:09 danielkoller

@danielkoller by any chance do you use jsconfig path aliases ? if so can you share it with me ?

Viijay-Kr avatar Oct 16 '23 04:10 Viijay-Kr

Hi @Viijay-Kr, I do. Here you go ->

"paths": { "@/components/": [ "src/components/" ] }

danielkoller avatar Oct 16 '23 05:10 danielkoller

Ok that's great .Thanks :). #113 this should fix the issue

Viijay-Kr avatar Oct 16 '23 08:10 Viijay-Kr

@danielkoller This should be fixed with the latest version of the extension. Do let me know if you find any issues

Viijay-Kr avatar Oct 18 '23 15:10 Viijay-Kr

@Viijay-Kr no issues, thanks for the great work and fast fix. :)

danielkoller avatar Oct 18 '23 20:10 danielkoller

@Viijay-Kr version: v3.2.5 I am still experiencing the same issue. It occurs when importing through the path alias.

image

following is my jsconfig.json.

{
  "compilerOptions": {
    "baseUrl": "src",
    "paths": {
      "@src/*": ["."],
      "@pages/*": ["pages/*"],
      "@common/*": ["common/*"],
      "@comComponents/*": ["common/components/*"],
      "@service/*": ["service/*"],
      "@model/*": ["model/*"],
      "@commonComponents/*": ["pages/common/*"]
    }
  },
  "include": ["src"]
}

Your extension would be fantastic if it could resolve this issue.

logone72 avatar Dec 12 '24 00:12 logone72

@logone72 can you also provide me the path of the file where you see this error ?

Viijay-Kr avatar Dec 14 '24 10:12 Viijay-Kr

@logone72 can you try updating v3.2.6 and see if the issue is fixed for you ?

Viijay-Kr avatar Dec 25 '24 09:12 Viijay-Kr

This is my jsconfig.json.

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"]
    },
    "types": ["cypress", "@testing-library/cypress"]
  },
  "exclude": ["node_modules", "dist"]
}

I'm getting the same error, "module not found". Changing @ to src resolves the problem. I'm on version 3.2.7.

Maki-Db avatar Jan 11 '25 10:01 Maki-Db

I'm getting the same error for an import from the same folder:

Image

As stated, everything works, but there is a red underline. The file exists.

Also, sometimes the error goes away, so it is intermittent.

This is basically preventing us from using your extension as it is difficult to ignore a red error in every file.

NoelAbrahams avatar Nov 17 '25 11:11 NoelAbrahams

Turning off diagnostics doesn't help either.

What's the point in starting off a project and then promptly abandoning it?

NoelAbrahams avatar Nov 17 '25 13:11 NoelAbrahams