-
Notifications
You must be signed in to change notification settings - Fork 310
Description
Describe the bug
Evidence dev server starts successfully (HTTP 200) but pages fail to render due to Tailwind CSS configuration errors. The @tailwindcss/vite plugin crashes with "Cannot convert undefined or null to object" during CSS generation.
Root Cause
The EvidenceConfigSchema in @evidence-dev/sdk/src/configuration/schemas/config.schema.js only validates three properties:
layoutpluginsdeployment
However, loadThemesConfig() in @evidence-dev/tailwind expects appearance and theme sections from the config. When these sections are stripped by schema validation, the theme loader receives undefined/null, causing Tailwind v4 to crash.
Relevant code:
// @evidence-dev/sdk/src/configuration/schemas/config.schema.js
export const EvidenceConfigSchema = z.object({
layout: z.string().or(z.literal(false).default(false)).optional(),
plugins: PluginConfigSchema,
deployment: DeploymentConfigSchema.optional().default({})
});
// NOTE: appearance and theme are NOT includedExpected Behavior
Pages should render with configured theme colors and appearance settings.
Actual Behavior
Multiple errors in logs:
[vite] Internal server error: Cannot convert undefined or null to object
Plugin: @tailwindcss/vite:generate:serve
File: /node_modules/@evidence-dev/tailwind/src/fonts.css
at M.generate (file:///.../node_modules/@tailwindcss/vite/dist/index.mjs:1:5762)
Pages return HTTP 200 but fail to render due to missing CSS.
Steps to Reproduce
- Create a valid
evidence.config.yamlwithappearanceandthemesections as documented - Run
npm install && npm run dev - Observe Tailwind CSS errors in browser console and server logs
System Info
## Environment
- Evidence: 40.1.2
- @evidence-dev/tailwind: 3.0.10
- @evidence-dev/core-components: 5.2.2
- Node.js: 24.10.0
- Platform: macOS (Darwin 25.0.0)
## Configuration File
appearance:
default: system
switcher: true
theme:
colorPalettes:
default:
light: [...]
dark: [...]
colorScales:
default:
light: [...]
dark: [...]
colors:
primary:
light: "#0F766E"
dark: "#14B8A6"
# ... other colorsSeverity
blocking all usage of Evidence
Additional Information, or Workarounds
Attempted Workarounds
- Added
package-lock=trueto .npmrc (suggested in issue [Bug]: [vite] Internal server error: Cannot convert undefined or null to object #3156) - no effect - Removed node_modules and clean reinstall - no effect
- Cleared npm cache and reinstalled - no effect
- Modified
app.cssto remove@configdirective - reverted by Evidence build
Impact
Server runs but application is non-functional due to missing CSS. This blocks local development and testing.
Suggested Fix
Update EvidenceConfigSchema to include appearance and theme sections, or modify loadThemesConfig() to handle schema validation differently to preserve these sections.
Related Issues
- Issue [Bug]: [vite] Internal server error: Cannot convert undefined or null to object #3156 reports similar error but different root cause (package-lock)
- Issue [Bug]: "Cannot convert undefined or null to object" when trying to create an SQLite Source Query #3173 reports similar "Cannot convert undefined or null to object" with SQLite sources