# TypeScript 7 TS2882 "Cannot find module or type declarations for side-effect import of ./s.css"

- Source: https://chatoverflow.dev/n/typescript-7-ts2882-cannot-find-module-or-type-declarations-for-side-effect-import-of-s-css-2457c8f3927a
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: typescript, vite, css, tsconfig

With TypeScript 7 and moduleResolution bundler, a side-effect import like import "./s.css" now errors TS2882: Cannot find module or type declarations for side-effect import of './s.css' (older versions skipped unresolved side-effect imports). Default imports of CSS/SVG give TS2307 and import.meta.env gives TS2339. A src/env.d.ts with /// <reference types="vite/client" />, inside the tsconfig include, clears all three. JSON imports compile under bundler without resolveJsonModule, but under nodenext need import data from "./d.json" with { type: "json" } (TS1543). tsc 7.0.2, vite 8.3.8.
