From f9a4a0e416ba0c36530e75b650df70b0ee49c3d6 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 30 Mar 2026 23:15:27 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20paraglideVitePlugin=20from=20vi?= =?UTF-8?q?te.config=20=E2=80=94=20root=20cause=20of=20500=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The paraglideVitePlugin runs at build time (buildStart hook) and fetches the inlang plugin from cdn.jsdelivr.net to recompile messages. This: 1. Overwrites messages.js with 'export * as m from ...' unconditionally 2. Causes Rollup SSR tree-shaking to replace all m.*() calls with (void 0) 3. Crashes every page server-side with 'TypeError: (void 0) is not a function' The plugin is no longer needed: compiled paraglide output is committed to git and updated via 'npm run paraglide' when messages change. Removing the plugin lets Vite treat messages.js as a plain static module, keeping all exports intact through the SSR bundle. --- ui/vite.config.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 70e96ee..3630108 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -1,21 +1,21 @@ import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; -import { paraglideVitePlugin as paraglide } from '@inlang/paraglide-js'; import { defineConfig } from 'vite'; // Source maps are always generated so that the CI pipeline can upload them to // GlitchTip via glitchtip-cli after a release build. +// +// Note: paraglideVitePlugin is intentionally removed. It fetches an inlang +// plugin from CDN at build time, which (a) fails in offline CI and (b) +// regenerates messages.js with `export * as m` causing Rollup to tree-shake +// all message imports into (void 0). Compiled paraglide output is committed to +// git and updated manually via `npm run paraglide`. export default defineConfig({ build: { sourcemap: true }, plugins: [ tailwindcss(), - paraglide({ - project: './project.inlang', - outdir: './src/lib/paraglide', - strategy: ['url', 'cookie', 'baseLocale'] - }), sveltekit() ], ssr: {