Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/dev-vite-fs-allow.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions apps/site-builder/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair flag, but the exposure this describes needs the dev server reachable off-localhost — which the CLI never enables. The materialized server is react-router dev bound to localhost by default, and the bin runs it with no --host passthrough, so @fs paths are only reachable from the local machine.

A precise server.fs.allow list is the "correct" alternative, but it's brittle here: the deps are symlinked in and their realpaths live in different roots per install (npx cache, pnpm store, workspace root), so an allowlist would be layout-dependent and isn't exercised in CI (dev has no CI coverage). Keeping fs.strict: false for this localhost-only dev tool.

});