Windows Path Separator Issue #2105
dingshaohua-com
started this conversation in
Bugs & Feedback
Replies: 1 comment
-
How to Use This Patch
{
"pnpm": {
"patchedDependencies": {
"@mintlify/prebuild": "patches/@mintlify__prebuild.patch"
}
}
}
Done! The patch will be applied automatically. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug Report: Windows Path Separator Issue
Title: Navigation warnings and missing sidebar titles on Windows due to path separator mismatch
Description
When running
mint devon Windows, the CLI reports warnings that files referenced indocs.jsondo not exist, even though the files are present. Additionally, the sidebar displays file paths instead of thetitlefrom MDX frontmatter. This issue does not occur on macOS or Linux.Environment
mintpackage)Steps to Reproduce
Create a Mintlify project on Windows with the following structure:
Configure
docs.jsonwith navigation:{ "navigation": { "tabs": [ { "tab": "Python", "groups": [ { "group": "Getting Started", "pages": ["contents/python/index"] } ] } ] } }Run
mint devon Windows.Expected Behavior
titlefrom MDX frontmatterActual Behavior
"contents/python/index" is referenced in the docs.json navigation but the file does not exist.Root Cause Analysis
The issue is in
@mintlify/prebuildpackage, specifically indist/fs/index.js.The
getFileListfunction usespath.relative()which returns backslashes (\) on Windows:This produces paths like
/contents\python\index.mdx, which don't match the forward-slash paths indocs.json(contents/python/index).Suggested Fix
Normalize path separators to forward slashes:
The same fix should be applied to:
getFileListSync(line 14)getFileListWithDirectories(lines 27, 34)Workaround
Manually patch
node_modules/@mintlify/prebuild/dist/fs/index.jswith the fix above, or use WSL on Windows.Beta Was this translation helpful? Give feedback.
All reactions