Skip to content

fix(docs): resolve Nitro build failure for site config import - #5

Merged
0froq merged 1 commit into
mainfrom
cursor/fix-og-site-resolve-843d
Oct 15, 2026
Merged

0froq merged 1 commit into
mainfrom
cursor/fix-og-site-resolve-843d

Conversation

@0froq

@0froq 0froq commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Problem

After PR #4 (og-layer adoption), Cloudflare Workers Build fails during pnpm generate:

RollupError: Could not resolve "docs/shared/site.ts" from ".nuxt/dist/server/server.mjs"

Production still serves the old static og.png because deploy never completes.

Root cause

docs/shared/site.ts lived outside Nuxt's app/ source root. Composables re-exported it via app/utils/site.ts, but Vite/Nitro left a broken external import (../../../../../../../docs/shared/site.ts) in the server bundle during prerender.

Fix

  • Move site constants/helpers into docs/app/utils/site.ts (single source of truth).
  • Point nuxt.config.ts at ./app/utils/site.
  • Remove docs/shared/site.ts.

Verification

Locally with Workers Build parity (NODE_VERSION=22, pnpm install --frozen-lockfile && pnpm generate):

  • Generate succeeds; 358 routes prerendered including /_og/s/*.png.
  • dist/index.html: og:image → https://ui.sayhola.workers.dev/_og/...png, og:url → https://ui.froq.me.
  • pnpm check (lint, typecheck, check:tokens) passes.
Open in Web Open in Cursor 

Nitro prerender failed to resolve docs/shared/site.ts because Vite
externalized it outside the app source root. Inline constants in
app/utils/site.ts so OG meta composables bundle correctly.

Co-authored-by: froQ <sayhola@froq.me>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
8779aac 2026-10-15T04:49:50.248Z View logs ↗

@0froq
0froq marked this pull request as ready for review October 15, 2026 05:01
@0froq
0froq merged commit f196627 into main Oct 15, 2026
1 of 2 checks passed
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.

2 participants