Skip to content

fix(docs): bundle all former docs/shared helpers under app/utils - #6

Merged
0froq merged 1 commit into
mainfrom
cursor/fix-shared-bundle-843d
Oct 15, 2026
Merged

0froq merged 1 commit into
mainfrom
cursor/fix-shared-bundle-843d

Conversation

@0froq

@0froq 0froq commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Problem

PR #5 fixed site.ts only. Workers Build still fails at Nitro prerender:

Could not resolve "../../../../../../../../docs/shared/component-files.ts"

The failure depends on checkout path depth (/opt/buildhome/repo vs /workspace). Vite externalized docs/shared/* with broken relative IDs instead of bundling them.

Fix

Move all remaining docs/shared/* modules into docs/app/utils/:

  • component-files.ts, empty-title.ts, public-files.ts

Update imports:

  • nuxt.config.ts → ./app/utils/...
  • app/utils/components.ts → ~/utils/component-files

Remove docs/shared/ (Nuxt #shared alias is unused; config cannot import #shared before Nuxt boots).

Adjust public-files public root to ../../public from app/utils.

Verification

Fresh tree at /opt/buildhome/repo (clean clone layout similar to Workers Build):

NODE_VERSION=22 pnpm install --frozen-lockfile && pnpm generate
  • Generate succeeds (358 routes, /_og/s/*.png prerendered).
  • grep -r 'docs/shared' docs/.nuxt/dist docs/.output → no matches.
  • pnpm check passes.
Open in Web Open in Cursor 

Relative imports from docs/shared were externalized with path-depth-dependent
rollup IDs, breaking Nitro prerender on Workers Build. Colocate build helpers
in app/utils and import via ~/utils or ./app/utils from nuxt.config.

Co-authored-by: froQ <sayhola@froq.me>
@0froq
0froq marked this pull request as ready for review October 15, 2026 05:11
@0froq
0froq merged commit 8888e40 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