Skip to content

fix(docs): strip leftover preload hashes to fix client hydration and search - #1126

Closed
gilangabdian wants to merge 1 commit into
rolldown:mainfrom
gilangabdian:fix/button-navbar-do-not-work
Closed

gilangabdian wants to merge 1 commit into
rolldown:mainfrom
gilangabdian:fix/button-navbar-do-not-work

Conversation

@gilangabdian

@gilangabdian gilangabdian commented Nov 9, 2026 •

Copy link
Copy Markdown

AI usage

  • No AI was used in this PR.
  • AI was used: Antigravity
    • I have carefully reviewed the AI-generated content myself.

Description

In production documentation builds (tsdown.dev and pnpm docs:preview), Rolldown's preload plugin left behind 32-character hex hashes attached to Vite's dynamic import preload replacements (__vite__mapDeps(...) and []).

This caused a fatal SyntaxError: missing ) after argument list in the generated chunks, which broke:

  1. Vue client-side hydration: Theme switcher (dark/light), version dropdown, language selector, and tablet/mobile navigation screen.
  2. Search modal (Ctrl + K): Clicking the search button or pressing Ctrl + K failed when dynamically importing VPLocalSearchBox.

This PR adds a buildEnd hook in docs/.vitepress/config/index.ts to cleanly strip the leftover 32-character hex hashes from both __vite__mapDeps(...) and [] in the output asset chunks.

Linked Issues

Trying to fix #1125

Additional context

  • This issue only occurs in production builds (pnpm docs:build / pnpm docs:preview) because Vite serves unbundled modules without Rolldown preload replacement in pnpm docs:dev.
  • Verified that all 392 generated JS asset chunks are syntactically valid with 0 errors.
  • pnpm lint and pnpm typecheck pass cleanly with 0 errors and 0 warnings.

@netlify

netlify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 1ab613d
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6af188edcea8d438eada808a
😎 Deploy Preview https://deploy-preview-1126--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown@1126 -D
npm i https://pkg.pr.new/rolldown/tsdown@1126 -D
yarn add https://pkg.pr.new/rolldown/tsdown@1126.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1126 -D
npm i https://pkg.pr.new/rolldown/tsdown/create-tsdown@1126 -D
yarn add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1126.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1126 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1126 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1126.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1126 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1126 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1126.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1126 -D
npm i https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1126 -D
yarn add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1126.tgz -D

commit: 1ab613d

@sxzz

sxzz commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Is this a bug from VitePress? Should we just report it to the upstream?

@sxzz sxzz closed this Nov 9, 2026
@sxzz

sxzz commented Nov 9, 2026

Copy link
Copy Markdown
Member

Sorry, this patch seems like to fragile, we should fix it upstream.

@gilangabdian

Copy link
Copy Markdown
Author

yeah, i had dug deeper and found that the cause of this problem seem from upstream. I completely agree that fixing this in upstream (Rolldown / Vite) is the cleaner and permanent solution.

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.

docs: on the navigation bar (navbar), especially in the button version, the features to change the language, search and theme do not work.

2 participants