From b8c6f9fa6e78f190e44d2045882a232e4c65eb70 Mon Sep 17 00:00:00 2001 From: ath1614 Date: Wed, 26 Nov 2025 16:49:26 +0530 Subject: [PATCH] fix: add empty transform to vite scan plugin for Vite 7.0+ compatibility Fixes #19376 - Cannot read properties of undefined (reading 'call') - Added empty transform() function to @tailwindcss/vite:scan plugin - Returns null to tell Vite to skip transformation for this plugin - Prevents undefined error when Vite 7.0+ tries to call plugin.transform.call() - Maintains backward compatibility with older Vite versions --- packages/@tailwindcss-vite/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/@tailwindcss-vite/src/index.ts b/packages/@tailwindcss-vite/src/index.ts index 709ab9db0a15..caa6964b88d5 100644 --- a/packages/@tailwindcss-vite/src/index.ts +++ b/packages/@tailwindcss-vite/src/index.ts @@ -114,6 +114,11 @@ export default function tailwindcss(opts: PluginOptions = {}): Plugin[] { minify = opts.optimize.minify !== false } }, + + // Add empty transform to prevent Vite 7.0+ from trying to call undefined transform + transform() { + return null + }, }, {