fix: remove paraglideVitePlugin from vite.config — root cause of 500 errors
Some checks failed
CI / Backend (push) Failing after 11s
CI / UI (push) Successful in 45s
Release / Test backend (push) Successful in 53s
Release / Check ui (push) Successful in 1m3s
Release / Docker / caddy (push) Successful in 55s
CI / Backend (pull_request) Successful in 48s
Release / Docker / backend (push) Failing after 11s
Release / Docker / runner (push) Failing after 11s
CI / UI (pull_request) Successful in 50s
Release / Docker / ui (push) Successful in 2m20s
Release / Gitea Release (push) Has been skipped
Some checks failed
CI / Backend (push) Failing after 11s
CI / UI (push) Successful in 45s
Release / Test backend (push) Successful in 53s
Release / Check ui (push) Successful in 1m3s
Release / Docker / caddy (push) Successful in 55s
CI / Backend (pull_request) Successful in 48s
Release / Docker / backend (push) Failing after 11s
Release / Docker / runner (push) Failing after 11s
CI / UI (pull_request) Successful in 50s
Release / Docker / ui (push) Successful in 2m20s
Release / Gitea Release (push) Has been skipped
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.
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
import tailwindcss from '@tailwindcss/vite';
|
import tailwindcss from '@tailwindcss/vite';
|
||||||
import { paraglideVitePlugin as paraglide } from '@inlang/paraglide-js';
|
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
// Source maps are always generated so that the CI pipeline can upload them to
|
// Source maps are always generated so that the CI pipeline can upload them to
|
||||||
// GlitchTip via glitchtip-cli after a release build.
|
// 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({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
paraglide({
|
|
||||||
project: './project.inlang',
|
|
||||||
outdir: './src/lib/paraglide',
|
|
||||||
strategy: ['url', 'cookie', 'baseLocale']
|
|
||||||
}),
|
|
||||||
sveltekit()
|
sveltekit()
|
||||||
],
|
],
|
||||||
ssr: {
|
ssr: {
|
||||||
|
|||||||
Reference in New Issue
Block a user