You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug Report][4.0.4] error TS2882: Cannot find module or type declarations for side-effect import of 'vuetify/styles'. #22766
Vuetify Version: 4.0.4 Vue Version: 3.5.31 OS: Linux
Steps to reproduce
create new vuetify project
update typescript dependency from 5.x.x to 6.x.x
Run pnpm vue-tsc -b
src/main.ts:1:8 - error TS2882: Cannot find module or type declarations for side-effect import of 'vuetify/styles'.
1 import "vuetify/styles";
~~~~~~~~~~~~~~~~
Typescript 6 changed the default value for noUncheckedSideEffectImports to true. You can disable this again for now instead of adding the ignore comment.
What's the point of TS accessing styles anyway? IMO, should just do the job (autocomplete while typing in scripts and template) and avoid offsetting gains by wasting developers time with false-negatives. I agree slapping @ts-ignore is not pretty, but it just reflects the tooling fault.
tsc doesn't know vuetify/styles is a stylesheet, it'd be nice if they just checked for file/exports existence for side effect imports instead of needing a type declaration though.
This explains one of my questions: I can import "vuetify/lib/styles/main.css" but not import "vuetify/styles". Clearly it's a TypeScript breaking change. So maybe I could try "noUncheckedSideEffectImports": false for now? Or is it OK to move the import to my CSS entrypoint?
Activity
J-Sek commentedon Mar 26, 2026
+// @ts-ignore import 'vuetify/styles'Jisu-Woniu commentedon Mar 26, 2026
This looks like a temporary fix. What is the root cause here?
KaelWD commentedon Mar 26, 2026
Typescript 6 changed the default value for
noUncheckedSideEffectImportsto true. You can disable this again for now instead of adding the ignore comment.J-Sek commentedon Mar 26, 2026
What's the point of TS accessing styles anyway? IMO, should just do the job (autocomplete while typing in scripts and template) and avoid offsetting gains by wasting developers time with false-negatives. I agree slapping
@ts-ignoreis not pretty, but it just reflects the tooling fault.KaelWD commentedon Mar 26, 2026
microsoft/TypeScript#50394
tsc doesn't know
vuetify/stylesis a stylesheet, it'd be nice if they just checked for file/exports existence for side effect imports instead of needing a type declaration though.Jisu-Woniu commentedon Mar 26, 2026
This explains one of my questions: I can
import "vuetify/lib/styles/main.css"but notimport "vuetify/styles". Clearly it's a TypeScript breaking change. So maybe I could try"noUncheckedSideEffectImports": falsefor now? Or is it OK to move the import to my CSS entrypoint?Jisu-Woniu commentedon Mar 26, 2026
Having moved
import "vuetify/styles"tostyles.cssas:Now everything works fine.
fix: 🚨 fix TypeScript error TS2882
fix(types): add type declarations for CSS-only style exports to resol…
fix(types): add module declarations for side-effect style imports
J-Sek commentedon Mar 28, 2026
resolved by cli#11 for new projects
Existing projects can adapt (after upgrading to TS 6.0)
// @ts-ignoredeclare module 'vuetify/styles';in any*.d.tsfile laying aroundThis generally does not affect Nuxt projects
lukashroch commentedon Apr 9, 2026
@KaelWD could 2098fb1 be picked to v3? Or should v3 users with TS6 go for alt solutions J-Sek mentioned above?
fix(types): support noUncheckedSideEffectImports
bloodykheeng commentedon May 14, 2026
solution is to use workspace version typescript in vscode read here
1 Open the command palette (Ctrl/⌘ + Shift + P)
2 Search for "TypeScript: Select TypeScript Version"
3 Select "Use Workspace Version"
solution to this Next.js: "Cannot find module or type declarations for side-effect import of './globals.css'" ts(2882)