Repository navigation
fix(core): docusaurus serve serves folders with a dot in their name (AI-assisted) - #12896
Conversation
…AI-assisted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Motivation
docusaurus serveanswers 404 for pages in folders with a dot in their name, like a docs version (/docs/2.x/) or a package name (/docs/lodash.debounce/). serve-handler sees an extension (.x), finds a folder instead of a file, and doesn't look for itsindex.html.vercel/serve-handler#230 fixes it upstream, but serve-handler 6.1.8 isn't published yet: 6.1.7 is the latest version on npm. Until then,
docusaurus servepasses serve-handler anlstatmethod that hides these folders, so serve-handler falls back to theirindex.html, like the upstream fix does. TheTODOsays to remove it after the release.Like other URLs with an extension, these folders don't get the
trailingSlash: trueredirect:/docs/2.xservesdocs/2.x/index.htmldirectly.Test Plan
pnpm test packages/docusaurus/src/commands/serve: thedocs/2.xanddocs/lodash.debouncerows serve theirindex.html, and the edge case test is flipped to "serves the index.html of folders with a dot in their name".Test links
Deploy preview: https://deploy-preview-12896--docusaurus-2.netlify.app/
Related issues/PRs
docusaurus servehandles pages that look like assets (AI-assisted) #12892 capture the bug(AI-assisted)
🤖 Generated with Claude Code
Summary by CodeRabbit
lodash.debounce. Their index pages now load correctly at root and base URLs, regardless of the trailing-slash setting.