-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
When running svelte-check
or vitest
in a SvelteKit project using Vite 7, a persistent SSR error occurs deep inside the SvelteKit runtime. This appears to happen during SSR module evaluation. Simultaneously, a Tailwind CSS error Cannot apply unknown utility class
is thrown, likely as a symptom of the unstable build state caused by the SSR error.
The issue persists despite ensuring compatible dependencies, performing a full clean reinstall (rm -rf node_modules
, rm package-lock.json
, npm cache clean
), and correcting the Vite plugin order.
Reproduction
Reproduction
The error occurs consistently when running type checking or unit tests in a standard SvelteKit project with the dependencies listed below.
Steps to reproduce:
- Set up a SvelteKit project with
vite
,vitest
, and@tailwindcss/vite
. - Run
npm run check
ornpm run test:unit
. - The errors are logged to the console, although the process can finish successfully if the errors are treated as warnings.
Logs
Logs
Vite SSR Error:
`[vite] (ssr) Error when evaluating SSR module /@fs/.../node_modules/@sveltejs/kit/src/runtime/server/index.js: Cannot read properties of undefined (reading 'wrapDynamicImport')`
Tailwind CSS Error:
`Error: Cannot apply unknown utility class 'text-gray-500'.`
System Info
- OS: Windows
- SvelteKit: v2.22.0
- Vite: v7.0.4
- Tailwind CSS / @tailwindcss/vite: v4.1.11
- Node: v22.17.1
Severity
blocking all usage of SvelteKit
Additional Information
This appears to be a bug within the SvelteKit or Vite SSR runner, as standard troubleshooting steps (clean install, config correction) do not resolve the issue. The project's build process has been stabilized by treating these errors as non-failing warnings, but the underlying issue remains.