Css modules are not generating type definitions on buildscripts
See original GitHub issueThe build
script does not wait until all .d.ts css type definitions are done being generated before trying to compile, resulting in TS2307: Cannot find module './style.css' or its corresponding type declarations.
errors on CI builds.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Cannot see typing newly generated file (build error) #33
Start webpack in watch dev server mode; Create new css file like ... the type definition files are still missing and the build...
Read more >Create-react-app + TypeScript + CSS Modules - Stack Overflow
Existing workaround: You can manually create ComponentName.module.css.d.ts files with type definitions like this: export const identifierName: ...
Read more >Generating TypeScript definitions for CSS Modules using SASS
Tooling and approaches for integrating CSS Modules, SASS, and TypeScript to add additional type-safety when importing the styles.
Read more >Creating a React Component Library using Rollup, Typescript ...
If you don't want to use Sass, I'll also be showing you how to use CSS Modules, LESS, or Stylus to build your...
Read more >Frontend library development with vite and tailwindcss
Shows how to develop a library using vite and tailwindcss. We'll show you how to generate ... This will generate a CSS Modules...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I removed the
.css.d.ts
file generation, which is what allowed TS to build and would also give autocomplete help. It was replaced by a generic message to TS that all CSS files would be fine and a plugin to give autocomplete help. Should work on both IDEs (all IDEs) hopefully.Oh I thought you had removed the whole thing and it worked. Well so that’s definitely an improvement then, worst case scenario a VSCode user could write a plugin if they absolutely need CSS typings, if any. All people I know who care that much about types go with Webstorm though, so once the PR lands I’d say to close the issue.