-
Coming from Tailwind v3 and I have now otherwise managed to do the migration for my project, but having the The error
My css @import 'tailwindcss';
@custom-variant dark (&:is(.dark *));
@theme {
--font-scto-grotesk: "scto-grotesk";
}
/* Removing this fixes the error and everything works, except my font of course. */
@font-face {
font-family: 'scto-grotesk';
src:
local('scto-grotesk')
url('public/scto-grotesk-a-regular.otf') format('opentype');
}
html {
height: 100vh;
overflow-y: auto;
} For context /// <reference types="vitest" />
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import { ConfigEnv, defineConfig as defineViteConfig, mergeConfig } from 'vite'
import { checker } from 'vite-plugin-checker'
import tsconfigPaths from 'vite-tsconfig-paths'
import { configDefaults } from 'vitest/config'
const config = (env: ConfigEnv) =>
mergeConfig(
{
optimizeDeps: {
exclude: ['*.test.ts'],
},
plugins: [
tailwindcss(),
react(),
tsconfigPaths(),
env.mode !== 'test' &&
checker({
typescript: true,
eslint: {
useFlatConfig: true,
lintCommand: 'eslint "./src/**/*.{ts,tsx}"',
},
}),
],
},
{
test: {
environment: 'jsdom',
mockReset: true,
setupFiles: ['./vitest/setup.ts'],
exclude: [...configDefaults.exclude, 'playwright/**/*'],
globals: true,
},
},
)
export default defineViteConfig((env) => config(env)) |
Beta Was this translation helpful? Give feedback.
Answered by
jeknom
Feb 28, 2025
Replies: 1 comment 1 reply
-
Could you provide a reproduction git repo please? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I managed to figure out what causes the issue and created a reproduction repo here:
https://github.com/jeknom/tailwind-v4-unknown-word-repro
So basically we had a couple of places where a developer had tried to set the height of an element dynamically like so:
This combined with having the
@font-face
at rule in css will throw the error mentioned in my initial message. If I remove rule, everything works, if I remove this dynamic class, everything works. I think the error could be improved to indicate specifically that the dynamic variable is not allowed. It was difficult to find which specific files had this issue.