-
Notifications
You must be signed in to change notification settings - Fork 74
Not updating when new classes are added #95
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
Comments
It seems to take up to 15 seconds on my machine |
I'm having the same issue, but it never updates in my case, even after a restart of VS Code. The error says EDIT: My issue actually turns out to be #82, sorry for the noise. |
Hi @mariusGundersen - can you confirm that as @boformer indicated, this is showing up later? This plugin relies on TypeScript to watch file changes, so this might be a hard issue to solve. But any additional help could be much appreciated. |
No, it does not show up later, not as far as I can tell. |
Are you able to provide a reproduction, even something very simple, @mariusGundersen? I can look this weekend and try to resolve then :) |
@mariusGundersen were you ever able to resolve this? I also believe it is related to relative imports mentioned in #78 and #82, as I need to update my My {
"compilerOptions": {
"target": "es2019",
"module": "esnext",
"allowJs": false,
"checkJs": false,
"jsx": "react",
"declaration": false,
"resolveJsonModule": true,
"noEmit": true,
"strict": false,
"noImplicitAny": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"esModuleInterop": true,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"baseUrl": "src",
"paths": {
"styles/*": ["styles/*"],
},
"plugins": [
{
"name": "typescript-plugin-css-modules",
"options": {
"customMatcher": "\\.scss$",
}
}
]
},
"include": ["src/**/*"],
"exclude": ["node_modules"],
} @mrmckeb is there also a possibility that a sheer volume of |
Hey @mrmckeb, thanks for the great plugin. My coworker and I dug into this and narrowed it down to Note that:
I'm not sure what the best way for
|
Hi @gluxon, Thanks for the feedback - and for the very detailed/thorough analysis. And thanks for creating the issue with TypeScript, I've subscribed and will wait for an update. The TypeScript team have been fairly resistive to add more support for plugins like this so far, instead wanting to spend more time on TypeScript features (which I understand) and they seem concerned about supporting such APIs long-term (which again is understandable). I still think that they need to do this, long-term, as there will always be files that users want to import that don't are being transformed in some way. Today the only robust solution is to literally have a I've recently hit the same issue with I will leave this open and also keep thinking about ways to solve this, as I'd love to improve performance here too. |
Hi. Typescript team closes #41549 two monts ago. Did it really help? |
@sosoba The changes from #41549 aren't released on stable yet. It's pending for TypeScript 4.3: microsoft/TypeScript#42542 (comment) At writing the latest version of TypeScript is 4.2.4. |
If anyone has feedback on this in TS 4.3, please let us know here :) |
I've just updated a large codebase to TS 4.3. Unfortunately, I haven't seen any noticeable improvements for this problem. |
OK, thanks for the updates @davidmh. I'll keep an eye on this and see if there are any wins we can have here in future. |
I'm on Typescript 4.7.3 and it's still slow. Here's my workaround: I found a great idea on how to achieve it on StackOverflow. {
"version": "2.0.0",
"tasks": [
{
"label": "typescript-reload-projects",
"command": "${command:typescript.reloadProjects}"
}
]
} Then we have to install Trigger Task on Save extension and add this into VSCode's "triggerTaskOnSave.tasks": {
"typescript-reload-projects": ["*.scss"]
} |
From what I've heard (and seen), performance shouldn't be a big issue anymore @piotr-musialek-footballco - but that's a great solution for anyone that does have performance/sync issues, thanks! I'm going to close this off now as there's not a lot we can do from this side (as far as I can tell). |
I updated the codebase I was having issues with to TS 4.9, and the changes now reflect immediately! It looks like an improvement in their file-watching system: https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#file-watching-now-uses-file-system-events |
same error [email protected] |
work for me, thank you |
Glad that helped, thank you for sharing! It can be slow. Unfortunately there's not a lot I can do there for now as we rely on TypeScript's language service which doesn't natively support CSS files. |
I’m experiencing the same issue. My TypeScript version is 4.7.4, and this plugin takes about 20 seconds to reflect changes in my TypeScript file when the CSS module file is updated |
typescript: ^5 Encountered the same issue |
it helped |
Describe the bug
When I first import a css module in my tsx file it lists the classes that are in the css file. But when I add a new class to the css module file they do not show up in the ts intellisense. In other words, it seems like the classes are cached and the cache is not updated when the css file is edited and saved.
The text was updated successfully, but these errors were encountered: