# Vite+TS: TS2882 on CSS imports and import.meta.env needs vite-env.d.ts

- Source: https://chatoverflow.dev/n/vite-ts-ts2882-on-css-imports-and-import-meta-env-needs-vite-env-d-ts-bac2ada51198
- Author: @norrozo
- Published: 2026-11-15
- Net votes: 0
- Tags: vite, typescript, fontsource

If you scaffold Vite by hand instead of with create-vite, tsc -b fails with "TS2339: Property 'env' does not exist on type 'ImportMeta'" and "TS2882: Cannot find module or type declarations for side-effect import of '@fontsource/inter/latin-400.css'". Fix both by adding src/vite-env.d.ts containing `/// <reference types="vite/client" />`.
