fix(docs): unify lucide-react so fumadocs-core resolves once; guard the build - #152
Conversation
…he build PR #123's in-range deps refresh bumped the app's lucide-react to ^1.23.0 while the lockfile kept fumadocs-ui's edge on 1.16.0. lucide-react is a peer dependency of fumadocs-core, so bun's isolated linker materialized fumadocs-core@16.9.1 once per peer set: two module instances, two React contexts. RootProvider provided on one instance while components consumed the other, and every page crashed at hydration with "You need to wrap your application inside `FrameworkProvider`". The build stayed green, so the crash shipped and took production down; the vite 8.0.14 -> 8.1.3 bump in the same refresh was a red herring (verified innocent once lucide was unified). - Revert lucide-react to ^1.16.0 so app and fumadocs-ui share one install. - scripts/check-module-identity.ts (pre-build): fail if fumadocs-core, react, react-dom, @tanstack/react-router, or lucide-react resolve to different physical installs from the app vs fumadocs-ui. This would have failed PR #123 in CI (release:ci runs the docs build with the frozen lockfile). - scripts/check-client-bundle.ts (post-build backstop): fail if the framework-context module lands in more than one client chunk. - AGENTS.md: document the invariant for future deps refreshes. Production was restored by promoting the last good deployment (email-sdk-fumadocs-3wsvdubrx, commit 599b614); this makes main safe to deploy again. Generated-By: PostHog Code Task-Id: e66c853d-287b-4334-8055-51c53c0cd66b
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR restores the docs app to one shared Fumadocs/Lucide dependency path. The main changes are:
Confidence Score: 5/5Safe to merge with low risk. No issues were found. The lockfile change matches No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CI as CI / Deploy Build
participant Build as apps/fumadocs build
participant Identity as check-module-identity.ts
participant Vite as vite build
participant Bundle as check-client-bundle.ts
participant Output as Static client assets
CI->>Build: bun run build
Build->>Identity: verify app and fumadocs-ui singleton resolutions
alt duplicated physical installs
Identity-->>Build: exit 1 with resolved paths
Build-->>CI: fail before bundling
else single physical installs
Identity-->>Build: ok
Build->>Vite: build docs app
Vite->>Output: write client chunks
Build->>Bundle: scan emitted JS chunks for FrameworkProvider marker
alt context marker in multiple chunks
Bundle-->>Build: exit 1 with chunk names
Build-->>CI: fail post-build
else zero or one context chunk
Bundle-->>Build: ok
Build-->>CI: build continues to ensure-root-index
end
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CI as CI / Deploy Build
participant Build as apps/fumadocs build
participant Identity as check-module-identity.ts
participant Vite as vite build
participant Bundle as check-client-bundle.ts
participant Output as Static client assets
CI->>Build: bun run build
Build->>Identity: verify app and fumadocs-ui singleton resolutions
alt duplicated physical installs
Identity-->>Build: exit 1 with resolved paths
Build-->>CI: fail before bundling
else single physical installs
Identity-->>Build: ok
Build->>Vite: build docs app
Vite->>Output: write client chunks
Build->>Bundle: scan emitted JS chunks for FrameworkProvider marker
alt context marker in multiple chunks
Bundle-->>Build: exit 1 with chunk names
Build-->>CI: fail post-build
else zero or one context chunk
Bundle-->>Build: ok
Build-->>CI: build continues to ensure-root-index
end
end
|
What happened
Production (email-sdk.dev) crashed on every page with "You need to wrap your application inside `FrameworkProvider`" after the deploys on Jul 6. It has been restored by promoting the last good deployment (
email-sdk-fumadocs-3wsvdubrx, commit 599b614); this PR makesmainsafe to deploy again and adds guards so this class of failure can never ship silently.Root cause
#123's in-range deps refresh bumped the app's
lucide-reactto^1.23.0while the lockfile kept fumadocs-ui's edge on1.16.0.lucide-reactis a peer dependency of fumadocs-core, so bun's isolated linker materializedfumadocs-core@16.9.1once per peer set:Two module instances → two React contexts →
RootProviderprovided on one instance while components consumed the other → every page crashed at hydration. The build stayed green (runtime-only failure), so CI passed and the crash shipped.The
vite 8.0.14 → 8.1.3bump in the same refresh was a red herring: with lucide unified, vite 8.1.3 builds a clean single-instance bundle (verified in a browser).Fix
lucide-reactto^1.16.0so the app and fumadocs-ui share one install (lockfile unified, nested copy gone).scripts/check-module-identity.ts(pre-build): fails the build iffumadocs-core,react,react-dom,@tanstack/react-router, orlucide-reactresolve to different physical installs from the app vs fumadocs-ui. This would have failed chore(deps): refresh in-range dependencies to latest safe versions #123 in CI (release:ciruns the docs build against the frozen lockfile).scripts/check-client-bundle.ts(post-build backstop): fails if the framework-context module lands in more than one client chunk (bundler-level duplication).AGENTS.md: documents the invariant for future deps refreshes.Verification
types:checkpasses, 31/31 tests pass, and/,/docs,/docs/quickstart,/blogall hydrate cleanly in a real browser with zero console errors.Created with PostHog Code