build: guard Docusaurus SSG against wildcard routes on Windows#2881
Open
hercial61 wants to merge 1 commit intoMetaMask:mainfrom
Open
build: guard Docusaurus SSG against wildcard routes on Windows#2881hercial61 wants to merge 1 commit intoMetaMask:mainfrom
hercial61 wants to merge 1 commit intoMetaMask:mainfrom
Conversation
|
@hercialvitalis21 is attempting to deploy a commit to the Consensys Team on Vercel. A member of the Team first needs to authorize it. |
`docusaurus build` fails on Windows during static generation on any route whose path contains `*` (e.g. wildcard redirects or 404 fallbacks), because the default filename gets rejected by the Windows filesystem. `scripts/patch-docusaurus-windows-routes.js` patches the installed `@docusaurus/core` routes module to filter those paths out of the SSG list before build; the patch is idempotent and a no-op on non-Windows runs, so it's safe to prepend to the existing build pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run buildcrashes on Windows during static-site generation on any route whose path contains*(wildcard redirects, 404 fallbacks, etc.), because Windows rejects the generated filename.scripts/patch-docusaurus-windows-routes.js, which idempotently patches the installed@docusaurus/coreroutes module to filter wildcard paths out of the SSG list before build.buildscript so Windows contributors get a workingnpm run buildout of the box, without affecting macOS/Linux runs.Test plan
npm run buildsucceeds on Windows (previously failed with a filesystem error during SSG).npm run buildstill succeeds on macOS and Linux.npm installand thennpm run buildre-applies the patch cleanly (patch is idempotent).@docusaurus/coreversion bumps, the script should fail loudly if its expected needle text is no longer present — confirm by temporarily mutating the needle and re-running.🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it mutates
node_modules/@docusaurus/coreat build time using a string-replacement patch that could fail or become stale on Docusaurus upgrades.Overview
Fixes Windows
npm run buildfailures during Docusaurus static-site generation by filtering out wildcard (*) route paths from the list of SSG routes.This prepends a new, idempotent
scripts/patch-docusaurus-windows-routes.jsstep to thebuildscript that string-patches@docusaurus/core’sgetRoutesPathsimplementation and aborts loudly if the expected upstream file shape changes.Reviewed by Cursor Bugbot for commit 85993cf. Bugbot is set up for automated code reviews on this repo. Configure here.