Skip to content

fix error serving with older vite versions when config.css was not defined#19859

Open
mruthh wants to merge 1 commit intotailwindlabs:mainfrom
mruthh:fix/older-vite-crash-if-no-css-config
Open

fix error serving with older vite versions when config.css was not defined#19859
mruthh wants to merge 1 commit intotailwindlabs:mainfrom
mruthh:fix/older-vite-crash-if-no-css-config

Conversation

@mruthh
Copy link
Copy Markdown

@mruthh mruthh commented Mar 26, 2026

Summary

When attempting to serve a Vue app using Vite 4.3.5 with the tailwind/vite plugin, I received the following error:

[vite] Internal server error: Cannot read properties of undefined (reading 'devSourcemap')
  Plugin: @tailwindcss/vite:generate:serve

The issue was a missing ?. check. My vite.config file did not contain a css property and that crashed the plugin.

Test plan

  • In pnpm-workspace.yaml, change the vite version to ^4.3.5.
  • Run pnpm install
  • In playgrounds/vite, run pnpm build && pnpm vite
  • The example app should serve normally. Note that without the change from the PR, it fails to serve.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant