From 834c541a4efd92074bf92f0ebe0425ade124bb08 Mon Sep 17 00:00:00 2001 From: Ole Kristian Losvik Date: Sat, 25 Jul 2026 20:34:11 +0200 Subject: [PATCH] fix(cli): let the dev server read symlinked deps so `npx dev` isn't blank MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lectio dev` symlinks the site's deps in from wherever the package was installed (npx cache, pnpm store), whose realpaths sit outside the materialized site dir. Vite's dev server refused to serve them, so React Router's default client entry failed to load and the page rendered blank. Allow the dev server to read them (server.fs.strict: false — dev-server only, the static build is unaffected). Co-Authored-By: Claude Opus 4.8 --- .changeset/dev-vite-fs-allow.md | 7 +++++++ apps/site-builder/vite.config.ts | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/dev-vite-fs-allow.md diff --git a/.changeset/dev-vite-fs-allow.md b/.changeset/dev-vite-fs-allow.md new file mode 100644 index 0000000..9e057aa --- /dev/null +++ b/.changeset/dev-vite-fs-allow.md @@ -0,0 +1,7 @@ +--- +"lectio-docs": patch +--- + +Fix `lectio dev` rendering a blank page when run via `npx` (or any install where +dependencies resolve outside the site dir). The materialized dev server now lets +Vite read the symlinked dependencies, so React Router's client entry loads. diff --git a/apps/site-builder/vite.config.ts b/apps/site-builder/vite.config.ts index 68ba30d..2b5356b 100644 --- a/apps/site-builder/vite.config.ts +++ b/apps/site-builder/vite.config.ts @@ -3,4 +3,10 @@ import { defineConfig } from 'vite'; export default defineConfig({ plugins: [reactRouter()], + // The `lectio` CLI symlinks the site's dependencies in from wherever the + // package was installed (npx cache, pnpm store, …), whose realpaths sit + // outside the materialized site dir. Let the dev server read them — otherwise + // React Router's default client entry can't load and the page renders blank. + // Dev-server only; the static build is unaffected. + server: { fs: { strict: false } }, });