Fix build script for WF docs; correct content issues - #10412
Merged
Merged
Conversation
This commit fixes a couple of related issues with the
`wallet-framework-docs` package:
\## Build issues
Running the `dev` or `build` package scripts under
`@metamask/wallet-framework-docs` stopped working after the ESM
migration. It seems that Docusaurus — or Docusaurus's usage of Webpack —
is not fully compatible with ESM, as it produces the following error:
```
[ERROR] Error: Unable to build website for locale en.
at tryToBuildLocale (~/core/node_modules/@docusaurus/core/lib/commands/build/build.js:76:15)
at async ~/core/node_modules/@docusaurus/core/lib/commands/build/build.js:34:9
at async mapAsyncSequential (~/core/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
at async Command.build (~/core/node_modules/@docusaurus/core/lib/commands/build/build.js:33:5)
at async Promise.all (index 0)
at async runCLI (~/core/node_modules/@docusaurus/core/lib/commands/cli.js:56:5)
at async file://~/core/node_modules/@docusaurus/core/bin/docusaurus.mjs:44:3 {
[cause]: TypeError: require.resolveWeak is not a function
at 9219 (server.bundle.js:30913:17)
at __webpack_require__ (server.bundle.js:31109:31)
at 8672 (server.bundle.js:20639:57)
at __webpack_require__ (server.bundle.js:31109:31)
at 6658 (server.bundle.js:30990:66)
at __webpack_require__ (server.bundle.js:31109:31)
at 7856 (server.bundle.js:21514:55)
at __webpack_require__ (server.bundle.js:31109:31)
at 5976 (server.bundle.js:21643:46)
at __webpack_require__ (server.bundle.js:31109:31)
}
```
To fix this, I've removed `"type": "module"` from
`wallet-framework-docs` so it is no longer ESM-only. Right now, that
doesn't cause any issues because the package is private. If we end up
publishing this package for any reason, we'll need to figure out a
different solution, but this solves the problem for now.
Making that change forced me to make an exception for
`wallet-framework-docs` in the Yarn constraints.
> [!NOTE]
> `platform-api-docs` also uses Docusaurus, but unexplicably, running
> `yarn docs:platform-api:build` seems to work just fine.
\## Content issues
Since we don't try to build `wallet-framework-docs` in CI, some of the
links in the docs were broken and we didn't know about them. I've fixed
them in this commit, too.
mcmire
force-pushed
the
get-wallet-framework-docs-to-build
branch
from
September 24, 2026 18:22
32b6fe0 to
ee51e26
Compare
mcmire
marked this pull request as ready for review
September 24, 2026 18:37
Mrtenz
approved these changes
Sep 24, 2026
Mrtenz
left a comment
Member
There was a problem hiding this comment.
That's weird. 😕 The Docusaurus CLI itself is ESM. But I don't see a good alternative here.
cryptodev-2s
approved these changes
Sep 24, 2026
This branch was successfully deployed
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.
Explanation
This commit fixes a couple of related issues with the
wallet-framework-docspackage:Build issues
Running the
devorbuildpackage scripts under@metamask/wallet-framework-docsstopped working after the ESM migration. It seems that Docusaurus — or Docusaurus's usage of Webpack — is not fully compatible with ESM, as it produces the following error:To fix this, I've removed
"type": "module"fromwallet-framework-docsso it is no longer ESM-only. Right now, that doesn't cause any issues because the package is private. If we end up publishing this package for any reason, we'll need to figure out a different solution, but this solves the problem for now.Making that change forced me to make an exception for
wallet-framework-docsin the Yarn constraints.Note
platform-api-docsalso uses Docusaurus, but unexplicably, runningyarn docs:platform-api:buildseems to work just fine.Content issues
Since we don't try to build
wallet-framework-docsin CI, some of the links in the docs were broken and we didn't know about them. I've fixed them in this commit, too.Manual testing steps
yarn workspace @metamask/wallet-framework-docs run dev. It should not produce any errors.yarn workspace @metamask/wallet-framework-docs run build. It should not produce any errors.References
Checklist
Note
Low Risk
Documentation package manifest, constraint exception, and internal doc links only; no runtime wallet or API behavior changes.
Overview
Restores
@metamask/wallet-framework-docsdev/buildafter the monorepo ESM migration by removing"type": "module"from that package’spackage.json, avoiding Docusaurus/Webpack failures (require.resolveWeak is not a function).Yarn constraints now skip the global
type: modulerequirement forDOCSITE_PACKAGES(currently only@metamask/wallet-framework-docs), with a comment noting Docusaurus’s ESM limitations.Writing Data Services tutorial links are updated to Docusaurus-style paths (
./getting-started/,./read-only-requests/and../getting-started/) instead of numbered relative paths that were broken when the site wasn’t built in CI.Reviewed by Cursor Bugbot for commit ee51e26. Bugbot is set up for automated code reviews on this repo. Configure here.