#Cannot find CSS module error

6 messages · Page 1 of 1 (latest)

mystic spindle
#

@thick star in vanilla JS/TS, you can only import code
that code has type that TypeScript checks

#

if you happen to import something that is not code, TS won't be able to find the types for that file, and you'll run into those kinds of errors

#

now, bundlers lets you bundle css files by importing them, but that is not soemthing that is supported by default by TS

#

you still have to provide TS with types, that can be used for type-checking

#

if you are using a framework or meta-framework, it should come with types builtin

#

Vite has

/// <reference types="vite/client" />

for example