Skip to content

fix(web): restore local dev startup#1667

Merged
earayu merged 1 commit into
mainfrom
dongdong/phase7-smoke-web-startup
Apr 24, 2026
Merged

fix(web): restore local dev startup#1667
earayu merged 1 commit into
mainfrom
dongdong/phase7-smoke-web-startup

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented Apr 24, 2026

Summary

  • remove fixed Fraunces weights while keeping the opsz axis so Next 15.5 treats the font config as a legal variable-font setup
  • remove --turbopack from the local dev entry so yarn dev / make serve-web can start with the existing MDX remark plugin options

Validation

  • yarn lint
  • git diff --check
  • PORT=3001 yarn dev started successfully, Next ready on http://localhost:3001
  • PORT=3001 make serve-web started successfully, Next ready on http://localhost:3001
  • smoke via make serve-web: / 200, /auth/signin 200, /workspace/collections 200
  • API smoke: /health 200, invalid /api/v1/login returns expected 400

Task #34 fix-forward for local deployment smoke.

@earayu earayu merged commit cd5f19d into main Apr 24, 2026
0 of 2 checks passed
@earayu earayu deleted the dongdong/phase7-smoke-web-startup branch April 24, 2026 21:33
earayu added a commit that referenced this pull request Apr 28, 2026
…1780)

`next dev --turbopack` is 10–50× faster than the Webpack default for
HMR + per-route first-compile. PR #1667 disabled it because the inline
remark `containerDirective` plugin in `next.config.ts` was a closure
that Turbopack's worker pool cannot serialize. Empirically the entire
JS plugin chain has the same problem — even after the inline closure
is hoisted to its own module, `next dev --turbopack` still aborts with

  Error: loader /node_modules/@next/mdx/mdx-js-loader.js for match
  "#next-mdx" does not have serializable options.

The trade-off here is unusual: this plugin chain is **dead code at
compile time**. There are zero `.mdx` pages in `web/src/**` (verified
via `find` + `grep`). All runtime markdown rendering happens through
`web/src/components/markdown.tsx`, which keeps its own React-side
`react-markdown` pipeline (gfm, highlight, directives, frontmatter,
headerId) — that path is untouched.

So: drop the JS plugin chain from `createMDXPlugin`. The `withNextMDX`
wrapper is kept (so `mdx-components.tsx` stays wired) and
`pageExtensions` keeps `'mdx'` (so the route resolver still recognises
the extension). When `.mdx` pages are actually introduced, the
recommended path is `experimental.mdxRs: true` (Rust-based, Turbopack-
compatible) — see updated comment in `next.config.ts` for context.

Re-enable the flag in `web/package.json:dev`. Local verification:
`./node_modules/.bin/next dev --turbopack` reaches "Ready" in 1.5 s
with zero loader-serialization errors; `yarn tsc --noEmit` reports
zero errors.

§K.12 invariant cross-check
============================
Largely n/a (frontend dev tooling). Direct hit:
- #12 (grep-zero LightRAG) — `rg -i lightrag web/src/` returns zero
  hits both before and after.

4-pattern pre-check matrix
==========================
- Pattern 1 v1 (`.mdx` page consumers): `find web/src -name '*.mdx'`
  returns zero. `rg "from '[^']*\\.mdx'" web/src` returns zero.
  Confirms the JS plugin chain has no live consumers.
- Pattern 1 v2 (runtime markdown plugin chain): unchanged in
  `components/markdown.tsx`. Removing JS plugins from `next.config.ts`
  does not affect document rendering — react-markdown imports its own
  copy of remarkGfm / rehypeHighlight / etc. directly.
- Pattern 2 (response-shape change list): n/a, this PR does not touch
  any backend or generated schema.
- Pattern 3 (additive helpers): n/a, dev-tooling only.

simple-stable directive 4-guardrail
===================================
- #1 不无限扩范围 — 2 files / +16 / -55. Did not extract plugins to
  modules (would be future-only dead code given zero `.mdx` files);
  did not switch to `experimental.mdxRs` (kept current MDX setup
  empty-but-present so future adopters re-add plugins explicitly).
- #2 尽快上线 — earayu2 directive: edit code → instant reload, no
  added manual burden. Turbopack ready in 1.5 s, HMR kicks in
  automatically; `dev` script still runs `yarn install && yarn
  i18n:sync` so engineers who pull dependency updates do not need
  any extra command.
- #3 简单稳定 — fewer plugins is fewer moving parts. The runtime
  markdown path keeps the production-tested chain.
- #4 私有化部署免维护 — operator-invisible; production builds
  unaffected (zero `.mdx` files means `next build` output is identical
  before/after).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant