Skip to content

fix(docs): fix errors in Clown Beatdown tutorial walkthrough#136

Merged
mHaines9219 merged 2 commits intodocs/frontend-tutorial-and-audit-fixesfrom
docs/tutorial-walkthrough-fixes
Mar 25, 2026
Merged

fix(docs): fix errors in Clown Beatdown tutorial walkthrough#136
mHaines9219 merged 2 commits intodocs/frontend-tutorial-and-audit-fixesfrom
docs/tutorial-walkthrough-fixes

Conversation

@mHaines9219
Copy link
Copy Markdown
Contributor

Summary

Walked through the entire Clown Beatdown tutorial end-to-end (project setup → contract → tests → deploy → CLI → frontend) and fixed every error that would block a developer.

Errors found and fixed

Project Setup

  • sforge init fails without --force — the packages/contracts directory already exists from the monorepo setup step, so sforge init refuses to run. Added --force flag.
  • mv -t src index.ts fails on macOS — the -t flag is GNU-only and doesn't exist on macOS. Changed to mv index.ts src/.

Frontend (Chapter 1)

  • Missing @vitejs/plugin-react-swcvite.config.ts imports @vitejs/plugin-react-swc but the react-ts template only installs @vitejs/plugin-react. Added install step.
  • Config type import breaks buildimport { Config, WagmiProvider } from wagmi fails in Vite production builds because Config is a type-only export. Fixed to import { type Config, WagmiProvider }.
  • Missing supporting filesmain.tsx and App.tsx import store/store, theme, pages/Home, pages/NotFound, App.css, and index.css but these are never defined in the tutorial. Added a "Supporting files" section.

Frontend (Chapter 2)

  • ShieldedPublicClient/ShieldedWalletClient type imports break build — these are type-only exports from seismic-viem. Fixed to type imports.
  • Missing ExplorerToast and useToastNotificationsuseGameActions imports these but they're never provided. Added a "Supporting components" section before useGameActions.

What worked correctly

  • Contract code compiles and all 9 tests pass with sforge build && sforge test
  • CLI code is structurally correct and type-checks
  • Deployment script is valid (though sforge script --broadcast crashes with a known sforge infrastructure bug on shielded writes)

Test plan

  • Follow the tutorial from scratch on a clean macOS machine
  • Verify sforge init --force works in the monorepo setup
  • Verify mv index.ts src/ works on macOS
  • Verify bun add -d @vitejs/plugin-react-swc + npx vite build succeeds
  • Verify all frontend files from the tutorial are accounted for

Walked through the Clown Beatdown tutorial start to finish and fixed
all errors that would block a developer:

- Add --force flag to sforge init (directory already exists in monorepo)
- Replace mv -t with mv src/ (macOS doesn't support GNU -t flag)
- Add missing bun add -d @vitejs/plugin-react-swc install step
- Fix Config import to use type keyword (breaks Vite production build)
- Fix ShieldedPublicClient/ShieldedWalletClient to type imports
- Add missing supporting files: store, theme, pages, ExplorerToast,
  useToastNotifications, stylesheets
Additional fixes found during end-to-end testing:

- Bump seismic-viem from 1.0.9 to 1.1.1 in CLI package.json
  (1.0.9 doesn't export sanvil/seismicTestnet chain configs)
- Split deploy script: constructor-only deploy via sforge script,
  then add secrets via scast send (sforge script --broadcast
  crashes when broadcasting shielded writes like addSecret)
- Add hexToString decoding to CLI rob() method so secrets display
  as readable strings instead of raw hex
@mHaines9219 mHaines9219 merged commit 35f4480 into docs/frontend-tutorial-and-audit-fixes Mar 25, 2026
2 checks passed
@mHaines9219 mHaines9219 deleted the docs/tutorial-walkthrough-fixes branch March 25, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant