Repository navigation
fix(docs): strip leftover preload hashes to fix client hydration and search - #1126
Closed
gilangabdian wants to merge 1 commit into
Closed
gilangabdian wants to merge 1 commit into
gilangabdian wants to merge 1 commit into
Conversation
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
@tsdown/css
@tsdown/exe
tsdown-migrate
commit: |
Member
|
Is this a bug from VitePress? Should we just report it to the upstream? |
Member
|
Sorry, this patch seems like to fragile, we should fix it upstream. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI usage
Description
In production documentation builds (
tsdown.devandpnpm 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 listin the generated chunks, which broke:Ctrl + K): Clicking the search button or pressingCtrl + Kfailed when dynamically importingVPLocalSearchBox.This PR adds a
buildEndhook indocs/.vitepress/config/index.tsto 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
pnpm docs:build/pnpm docs:preview) because Vite serves unbundled modules without Rolldown preload replacement inpnpm docs:dev.pnpm lintandpnpm typecheckpass cleanly with 0 errors and 0 warnings.