Have you read the Contributing Guidelines on issues?
Prerequisites
Description
- In a fresh Docusaurus project on Windows using npm, creating
docs/contribute/index.mdx works fine.
- However, moving that same file into
docs/contribute/vulnerability-report/index.mdx causes the build to fail.

- Renaming the folder
vulnerability-report to foo-bar resolves the issue.

- Moving the file back to
docs/contribute/index.mdx also resolves it. The problem occurs with both .mdx and .md extensions.
- Moving the file back to
docs/contribute/vulnerability-report/index.mdx again, the build fail again.
Reproducible demo
https://github.com/coder-xiaomo/docusaurus-bug-minimal-repro/commits/main/
Steps to reproduce
-
Create a new Docusaurus project using npm on Windows:
npx create-docusaurus@latest my-website classic --typescript
cd my-website
npm install
-
Create a file docs/contribute/index.mdx with any content (e.g., # Test).
-
Run npm start – the site builds successfully and the doc displays at /docs/contribute.
-
Stop the server. Move the file into a new subdirectory vulnerability-report:
mkdir docs\contribute\vulnerability-report
move docs\contribute\index.mdx docs\contribute\vulnerability-report\index.mdx
Then run npm start – build fails (error details below).
-
Stop the server. Clean the cache and dependencies:
rmdir /s /q .docusaurus
rmdir /s /q node_modules
npm install
After reinstallation, run npm start again – the error still occurs.
-
Stop the server. Rename the vulnerability-report folder to foo-bar:
move docs\contribute\vulnerability-report docs\contribute\foo-bar
Run npm start – the build now works correctly.
-
Stop the server. Move the file back to docs/contribute/index.mdx:
move docs\contribute\foo-bar\index.mdx docs\contribute\index.mdx
Run npm start – the build works correctly again.
-
(Optional) Repeat the same steps using a .md file instead of .mdx – the problem is reproducible exactly the same way.
Expected behavior
The build should succeed, and the doc should be accessible at /docs/contribute/vulnerability-report without any hash mismatch. Deleting .docusaurus and node_modules should not be necessary for a correct build.
Actual behavior
When the file is located at docs/contribute/vulnerability-report/index.mdx, the build fails with a module resolution error:
× Cannot find module '@site/.docusaurus/docusaurus-plugin-content-docs/default/site-docs-contribute-vulnerability-report-index-mdx-e58.json' for matched aliased key '@site'
Meanwhile, inside .docusaurus/docusaurus-plugin-content-docs/default/, the actual generated file is:
site-docs-contribute-vulnerability-report-index-mdx-b66.json
Notice the hash mismatch: looking for -e58 but the file exists with -b66.
Your environment
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.(because of the network problem, I can't work with CodeSandbox and StackBlitz, but it can reproduce in the clean new project)
Description
docs/contribute/index.mdxworks fine.docs/contribute/vulnerability-report/index.mdxcauses the build to fail.vulnerability-reporttofoo-barresolves the issue.docs/contribute/index.mdxalso resolves it. The problem occurs with both.mdxand.mdextensions.docs/contribute/vulnerability-report/index.mdxagain, the build fail again.Reproducible demo
https://github.com/coder-xiaomo/docusaurus-bug-minimal-repro/commits/main/
Steps to reproduce
Create a new Docusaurus project using npm on Windows:
npx create-docusaurus@latest my-website classic --typescript cd my-website npm installCreate a file
docs/contribute/index.mdxwith any content (e.g.,# Test).Run
npm start– the site builds successfully and the doc displays at/docs/contribute.Stop the server. Move the file into a new subdirectory
vulnerability-report:Then run
npm start– build fails (error details below).Stop the server. Clean the cache and dependencies:
After reinstallation, run
npm startagain – the error still occurs.Stop the server. Rename the
vulnerability-reportfolder tofoo-bar:Run
npm start– the build now works correctly.Stop the server. Move the file back to
docs/contribute/index.mdx:Run
npm start– the build works correctly again.(Optional) Repeat the same steps using a
.mdfile instead of.mdx– the problem is reproducible exactly the same way.Expected behavior
The build should succeed, and the doc should be accessible at
/docs/contribute/vulnerability-reportwithout any hash mismatch. Deleting.docusaurusandnode_modulesshould not be necessary for a correct build.Actual behavior
When the file is located at
docs/contribute/vulnerability-report/index.mdx, the build fails with a module resolution error:Meanwhile, inside
.docusaurus/docusaurus-plugin-content-docs/default/, the actual generated file is:Notice the hash mismatch: looking for
-e58but the file exists with-b66.Your environment
Self-service