Skip to content

fix(website): migrate website to pnpm + fix MDX/dep issues blocking deploy#49

Merged
heggria merged 1 commit into
mainfrom
fix/website-deploy-pnpm
Jul 6, 2026
Merged

fix(website): migrate website to pnpm + fix MDX/dep issues blocking deploy#49
heggria merged 1 commit into
mainfrom
fix/website-deploy-pnpm

Conversation

@heggria

@heggria heggria commented Jul 6, 2026

Copy link
Copy Markdown
Owner

The deploy-website workflow has been failing since #26 (pnpm migration). Three root causes, all fixed here.

1. MDX syntax error (introduced by #46)

content/docs/zh-cn/guides/background-runs.mdx line 321 had bare {previous.output} / {args.*} / {item.*} in prose. MDX parses {...} as JSX expressions, and acorn choked (SyntaxError: Unexpected token). Wrapped them in inline code backticks.

2. npm ci crashing after pnpm migration

After #26 deleted the root package-lock.json, the workflow's npm ci (run inside website/) crashed with npm error Exit handler never called! after ~8 minutes (OOM). The website was the lone npm holdout in an otherwise-pnpm monorepo.

Fix: migrate the website to pnpm — add website to pnpm-workspace.yaml, delete website/package-lock.json, rewrite deploy-website.yml to use pnpm/action-setup + pnpm install --frozen-lockfile + pnpm run build. pnpm installs in ~15s vs npm ci's 8-min crash.

3. Missing direct dependencies (hidden by npm hoisting)

pnpm's strict node_modules does not hoist transitive deps. Two imports that worked under npm's hoisting now fail under pnpm:

Import Used in Added as
lucide-react app/[lang]/{page,layout,docs/.../page}.tsx dependency (^1.21.0, matching fumadocs-ui)
mdx/types components/mdx.tsx devDependency (@types/mdx@^2.0.14)

Verified locally

rm -rf website/node_modules node_modules
pnpm install --frozen-lockfile   # ~15s
cd website && pnpm run build     # ✓ 86/86 static pages (en + zh-cn)

Workflow after merge

deploy-website.yml runs on push to main (paths: website/**, docs/**, etc.). This PR will trigger it on merge — that run is the real validation.

…eploy

The deploy-website workflow has been failing since #26 (pnpm migration)
with `npm ci` crashing ("Exit handler never called!", 8-min OOM) and,
after #46, a Turbopack MDX syntax error. Root causes and fixes:

1. MDX syntax error (PR #46): bare `{previous.output}` / `{args.*}` /
   `{item.*}` in zh-cn/guides/background-runs.mdx were parsed as JSX
   expressions by acorn. Wrapped them in inline code backticks.

2. Migrate the website from npm to pnpm (the rest of the monorepo uses
   pnpm; the website was the lone npm holdout). Add `website` to
   pnpm-workspace.yaml, delete website/package-lock.json, and rewrite
   deploy-website.yml to use pnpm/action-setup + `pnpm install
   --frozen-lockfile` + `pnpm run build`. pnpm installs in ~15s vs
   npm ci's 8-min crash.

3. Declare missing direct deps that npm hoisting had hidden: add
   `lucide-react` (imported in app/[lang]/*) and `@types/mdx` (imported
   in components/mdx.tsx) to website/package.json. pnpm's strict
   node_modules does not hoist transitive deps, so these must be explicit.

Verified locally: clean `pnpm install --frozen-lockfile` + `pnpm run build`
emits all 86 static pages (en + zh-cn).
@heggria heggria force-pushed the fix/website-deploy-pnpm branch from c4bae0e to 21e578c Compare July 6, 2026 13:08
@heggria heggria merged commit 8316a45 into main Jul 6, 2026
6 checks passed
@heggria heggria deleted the fix/website-deploy-pnpm branch July 6, 2026 13:10
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