Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
docs(troubleshooting): redirect cjs section link to old docs
  • Loading branch information
sapphi-red committed May 21, 2025
commit ab375c3c36e23b9db93bdc72e3ce7dc20aa6940a
15 changes: 15 additions & 0 deletions docs/guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,18 @@ An example of cross drive links are:
- a symlink/junction to a different drive by `mklink` command (e.g. Yarn global cache)

Related issue: [#10802](https://github.com/vitejs/vite/issues/10802)

<script setup lang="ts">
// redirect old links with hash to old version docs
if (typeof window !== "undefined") {
const hashForOldVersion = {
'vite-cjs-node-api-deprecated': 6
}

const version = hashForOldVersion[location.hash.slice(1)]
if (version) {
// update the scheme and the port as well so that it works in local preview (it is http and 4173 locally)
location.href = `https://v${version}.vite.dev` + location.pathname + location.search + location.hash
}
}
</script>