Skip to content

fix(docs): update webapp-tutorial to current wallets/PXE API + fix vite polyfill resolution#23908

Merged
Thunkar merged 2 commits into
merge-train/fairies-v5from
cb/fix-webapp-tutorial-v5
Jun 8, 2026
Merged

fix(docs): update webapp-tutorial to current wallets/PXE API + fix vite polyfill resolution#23908
Thunkar merged 2 commits into
merge-train/fairies-v5from
cb/fix-webapp-tutorial-v5

Conversation

@AztecBot

@AztecBot AztecBot commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Why

The docs job on the merge-train/fairies-v5v5-next merge queue fails in validate-webapp-tutorial (docs/examples/bootstrap.sh). That step rewrites the tutorial's package.json to link: the in-repo @aztec/* packages, wipes yarn.lock, does a fresh yarn install, then tsc -b --noEmit + vite build against current HEAD. Nothing is pinned, so the tutorial has silently drifted from the live @aztec/wallets / PXE API and now fails to build. (Failing run: 27014367195.)

Two distinct breakages, both fixed here:

1. Fatal: vite/rollup can't resolve the node-polyfill shim

[vite]: Rollup failed to resolve import "vite-plugin-node-polyfills/shims/buffer"
  from "yarn-project/wallets/dest/embedded/wallet_db.js"

vite-plugin-node-polyfills injects …/shims/buffer imports into modules that use the Buffer global. Because @aztec/* are link:ed into the monorepo, that specifier resolves from the linked package dir (where the plugin isn't installed) and fails. Fixed by adding the same nodePolyfillsFix resolveId wrapper already used in playground/vite.config.ts (davidmyersdev/vite-plugin-node-polyfills#81), redirecting the shim specifiers to this project's installed copy. Verified shims/{buffer}/dist/index.cjs exists in the pinned vite-plugin-node-polyfills@^0.22.0.

2. Type drift vs the current wallets/PXE API

  • EmbeddedWallet.completeFeeOptions used the old positional signature (from, feePayer?, gasSettings?); the base BaseWallet.completeFeeOptions now takes a single CompleteFeeOptionsConfig. The override is rewritten to the new signature and now delegates to super.completeFeeOptions(config) (which handles gas settings, fee padding, congestion and account options), only swapping in SponsoredFeePaymentMethod when no feePayer was provided. This also drops the removed GasSettings.default(...) call.
  • This signature mismatch was the root of the cascading TS2684 / "connectTestAccount/getConnectedAccount do not exist on NodeEmbeddedWallet" errors in TwoPlayerLocal.tsx / WalletConnect.tsx: it made the subclass structurally incompatible with the base constructor, so EmbeddedWallet.create() could no longer infer the subclass type. Fixing the override resolves those without touching the components.
  • config.ts set config.l1Contracts = await aztecNode.getL1ContractAddresses(), but PXEConfig no longer has l1Contracts and createPXE already fetches L1 addresses from the node. Removed the line.

Note on verification

I couldn't run the full linked-package docs build locally (it needs the whole yarn-project toolchain built). Changes were validated against the current API source for each symbol used; the docs job in the merge queue is the gate. The tutorial is also identically stale on next/v5-next, so the same fix is worth forward-porting there.


Created by claudebox · group: slackbot

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. documentation labels Jun 5, 2026
@nchamo nchamo marked this pull request as ready for review June 5, 2026 15:28
@nchamo nchamo requested a review from a team as a code owner June 5, 2026 15:28
@nchamo nchamo added the ci-docs label Jun 5, 2026
@nchamo nchamo requested a review from Thunkar June 5, 2026 17:18

@Thunkar Thunkar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up a few unfortunate comments and fmt

@Thunkar Thunkar enabled auto-merge (squash) June 8, 2026 07:26
@Thunkar Thunkar merged commit e1ba815 into merge-train/fairies-v5 Jun 8, 2026
12 checks passed
@Thunkar Thunkar deleted the cb/fix-webapp-tutorial-v5 branch June 8, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-docs ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants