Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: folder returns 404 when it contains word index #248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

normanzb
Copy link

@normanzb normanzb commented Feb 20, 2025

fixed #238

  • see inline comment for why the fix.
  • not an expert on this repo but i followed the pattern in 05a953e , tested locally it works

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vocs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2025 2:22pm

@@ -48,7 +48,7 @@ export function virtualRoutes(): PluginOption {

let pagePath = path.replace(replacer, '').replace(/\.(.*)/, '')
if (pagePath.endsWith('index'))
pagePath = pagePath.replace('index', '').replace(/\/$/, '')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't want to replace all index in the pagePath into an empty string, it will break on pagePath such as indexer-ref/index

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.

404 on any folder that contains index
1 participant