Testnet MVP β€” Internal Monorepo SDK

Troubleshooting

Common errors and their fixes for the Fluppy SDK. Packages are internal workspace packages β€” see Installation for setup, and API Reference for usage.

Build & Workspace Issues

β„Ή
Always run pnpm install from the repository root, then build packages in dependency order: build:core β†’ build:browser β†’ build:react β†’ build:app.
Cannot find module '@fluppy/core'
Causepnpm install was not run from the monorepo root, or workspace symlinks are missing.
FixRun `pnpm install` from the repository root, then `pnpm build:core`.
Cannot find module '@fluppy/browser' / '@fluppy/react'
CauseThe package was not built β€” dist/ folder is empty or missing.
FixRun `pnpm build:browser` and/or `pnpm build:react` before starting the app.
Type error: Property 'X' does not exist on type (from @fluppy/*)
CauseStale dist/index.d.ts β€” package was updated in source but not rebuilt.
FixRebuild the package: `pnpm build:core`, `pnpm build:browser`, or `pnpm build:react`.
pnpm build:react: command not found
Causebuild:react script is missing from root package.json.
FixAdd "build:react": "pnpm --filter @fluppy/react build" to the root package.json scripts section.
TypeScript: rootDir or paths alias mismatch
Causetsconfig.json in a package uses absolute paths that break when consumed from app/.
FixDo not import package source files directly across package boundaries. Import from the built dist only via workspace:* resolution.
# Full clean build sequence from repository root
pnpm install
pnpm build:core
pnpm build:browser
pnpm build:react
pnpm --filter @fluppy/react typecheck
pnpm build:app

Environment Issues

[Stellar] NEXT_PUBLIC_CONTRACT_ID is required
Cause.env.local is missing or NEXT_PUBLIC_CONTRACT_ID is not set.
FixRun `cp app/.env.example app/.env.local` and fill in the Testnet values below.
[ZKP] NEXT_PUBLIC_NETWORK_PASSPHRASE missing
CauseNEXT_PUBLIC_NETWORK_PASSPHRASE is not set in .env.local.
FixSet NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015 in app/.env.local.
ChainIdMismatch β€” proof valid locally but contract rejects
CauseNEXT_PUBLIC_NETWORK_PASSPHRASE does not match the value used when the contract was initialized.
FixEnsure NEXT_PUBLIC_NETWORK_PASSPHRASE is exactly `Test SDF Network ; September 2015` (including the semicolon and spaces).
Environment variable updated but still using old value
CauseNext.js reads NEXT_PUBLIC_* variables at build/start time β€” changes require a server restart.
FixStop the dev server, edit .env.local, then run `pnpm dev` again.
app/.env.local (Testnet values)
NEXT_PUBLIC_CONTRACT_ID=CAGJIQ4W5Q7ZAYJ2QLH4M4TRIZJHFSDDJZ43PYAR4QEZVP76FTBDIBAS
NEXT_PUBLIC_RPC_URL=https://soroban-testnet.stellar.org:443
NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015

Wallet / Freighter Issues

[useFluppyWallet] Freighter returned no address
CauseFreighter extension is not installed, or the wallet is locked.
FixInstall Freighter from freighter.app, unlock it, and ensure it is set to Stellar Testnet.
[useFluppyWallet] Freighter access denied
CauseUser clicked Reject in the Freighter access popup.
FixCall `connect()` again and have the user click Approve in the Freighter popup.
Transaction rejected / signing failed
CauseUser rejected the transaction in Freighter, or Freighter is on the wrong network.
FixSwitch Freighter to Stellar Testnet and retry. User must click Approve in the signing popup.
Insufficient balance for transaction fee
CauseTestnet wallet has no XLM to pay the Soroban network fee.
FixFund the Testnet account at Stellar Laboratory or use the Friendbot API.
No USDC trustline or insufficient USDC balance
CauseThe user wallet does not have a USDC trustline or has insufficient Testnet USDC.
FixAdd USDC trustline in Freighter for the Testnet USDC asset, then fund via Testnet faucet.

Credential Issues

⚠
If a credential is deleted or the IndexedDB is cleared, the secret cannot be recovered without the original backup phrase shown at creation. Always display the backup secret to the user exactly once after create().
status: 'not_found' β€” no credential in IndexedDB
CauseNo credential has been created yet, or the browser's IndexedDB was cleared.
FixCall `create(password)` to create a new credential. Show the returned secret to the user as a backup phrase.
Wrong password or corrupted credential
CauseThe password provided to `unlock()` does not match the one used at `create()` time.
FixUse the correct password. If forgotten and no backup secret exists, delete the credential with `remove()` and create a new one.
Secret lost β€” user did not save backup
CauseThe raw secret is only returned once from `create()`. It cannot be recovered after that without the password.
FixDelete the credential with `remove()` and create a new one. Enroll the new commitment in the Merkle tree.
Secret appearing in console or network tab
CauseDeveloper code accidentally logs the secret returned from unlock().
FixNever call console.log(secret). Pass the secret directly from unlock() to pay() in the same async function.

Merkle / Root Sync Issues

404 commitment_not_enrolled from /api/merkle-proof
CauseThe commitment was never enrolled, or was enrolled to a different backend instance.
FixCall `enrollCommitment(secret)` before calling `getMerkleProof(secret)`.
RootSyncError: frontendRootHex !== contractRootHex
CauseThe Merkle tree root stored in the Soroban contract does not match the backend tree root.
FixThe contract admin must call `set_merkle_root` on the contract with the current backend root. Until then, no payments can proceed.
Stale Merkle root after new enrollments
CauseThe backend sparse tree singleton cache was rebuilt after the contract root was last set.
FixAdmin updates the contract Merkle root to match the current backend root. Restart the dev server to clear a stale in-memory cache.
Merkle proof path returns wrong depth or empty path
CauseCommitment enrolled to an old tree instance; backend was restarted without persisting the tree.
FixRe-enroll the commitment and request a fresh proof. In production, use a persistent Merkle tree backend.
β„Ή
The root sync guard in executeFluppyPayment() always checks the backend root against the contract root before generating a ZK proof. A RootSyncError means no proof was generated and no transaction was submitted. Only the admin can resolve this by updating the on-chain Merkle root.

ZK Proof Generation Issues

[artifacts] Failed to load WASM / ZKey artifact
CauseCircuit artifacts (circuit.wasm, circuit_final.zkey) are missing from the public/ directory or the path is wrong.
FixEnsure the artifact files are in app/public/circuit/ and that NEXT_PUBLIC_CIRCUIT_WASM_PATH / NEXT_PUBLIC_CIRCUIT_ZKEY_PATH are set correctly in .env.local.
[prover] Proof generation already in progress
CausegenerateZkProof() has a generation lock β€” only one proof runs at a time per session.
FixWait for the current proof to complete, or call `abort()` to cancel it before starting a new one.
AbortError during proof generation
CauseThe AbortSignal was triggered (user cancelled or component unmounted) during proof generation.
FixThis is expected behavior. Reset the payment state with `reset()` and start fresh.
[prover] Local verification FAILED
CauseThe generated proof is invalid β€” likely a circuit input mismatch (wrong secret, root, or recipient).
FixCheck that the secret, Merkle root, and merchant address all match the values used at enrollment. Rebuild circuit artifacts if recently changed.
Browser freezes or runs out of memory during proof
CauseGroth16 proof generation is CPU/memory intensive β€” some low-end browsers may struggle.
FixRetry in a desktop browser (Chrome or Firefox). Close other tabs to free memory. Safari may have WASM memory limitations on older versions.

Soroban Transaction Issues

Error code #4 β€” NullifierSpent
CauseThis proof's nullifier has already been used in a previous payment.
FixEach payment requires a fresh proof with a new CSPRNG nonce. Call executeFluppyPayment() again β€” a new nullifier is generated automatically.
Error code: ChainIdMismatch
CauseThe chainId public signal in the proof does not match the contract's expected network passphrase hash.
FixEnsure NEXT_PUBLIC_NETWORK_PASSPHRASE matches the value used when the contract was deployed. Testnet passphrase: `Test SDF Network ; September 2015`.
Error code: WrongMerkleRoot
CauseThe merkleRoot public signal in the proof does not match the root stored in the contract.
FixThe contract Merkle root must be updated by the admin to match the current backend tree. See Merkle / Root Sync section above.
Error code: RecipientMismatch
CauseThe recipientHash public signal does not match the merchant address passed to the contract.
FixEnsure the merchant address passed to pay() is the same G-address used to compute the recipientHash in the circuit.
Error code: InvalidPaymentAmount
CauseThe payment amount is outside the allowed range (minAmount–maxAmount public signals).
FixCheck the amount passed to pay(). Amount must be between MIN_AMOUNT and MAX_AMOUNT as defined in the circuit constants.
Error code #3 β€” ContractPaused
CauseThe contract admin has paused the protocol via set_pause().
FixContact the contract admin to unpause. Check with stellar.expert/explorer that the contract is active.
Transaction simulation failed
CauseSimulation errors usually indicate a contract logic issue, authorization problem, or wrong account state.
FixCheck the NEXT_PUBLIC_CONTRACT_ID. Ensure the Freighter-connected wallet is the transaction source. Check the console for the raw XDR simulation error.

React SDK Issues

[useFluppyContext] No FluppyProvider found in the component tree
CauseA Fluppy hook was called outside of a FluppyProvider subtree.
FixWrap the component tree with <FluppyProvider config={...}>. See Provider setup.
FluppyProvider: stellarConfig or networkPassphrase missing
CauseThe config object passed to FluppyProvider is missing required fields.
FixEnsure stellarConfig contains contractId, rpcUrl, and networkPassphrase. Also set networkPassphrase at the top-level config.
Secret accidentally stored in useState
CauseDeveloper stored the result of unlock() in a React state variable.
FixPass the secret directly from unlock() to pay() within the same async handler. Never store it: const [secret, setSecret] = useState() is incorrect.
useFluppyHistory: localStorage parse error on mount
CauseThe fluppy:payment-history:v1 localStorage key contains corrupted or incompatible data.
FixOpen browser DevTools β†’ Application β†’ Local Storage β†’ clear the key fluppy:payment-history:v1. The hook will reset to an empty array.
useFluppyWallet / useFluppyCredential called during SSR
CauseBrowser-only hooks are being invoked at render time in a server component.
FixAdd 'use client' to the component using these hooks. All Fluppy hooks are browser-only β€” they are SSR-safe but must run in a client component.
useFluppyPayment: pay() called but status stays idle
Causepay() was called outside a browser environment (e.g. in a test or SSR context).
Fixpay() throws '[useFluppyPayment] Payment can only run in a browser environment.' if called server-side. Ensure the component is client-side.

Quick Command Checklist

Run these commands in order when diagnosing any issue:

cd ~/fluppy

# 1. Reinstall all workspace dependencies
pnpm install

# 2. Rebuild packages in dependency order
pnpm build:core
pnpm build:browser
pnpm build:react

# 3. Typecheck React SDK
pnpm --filter @fluppy/react typecheck

# 4. Build the Next.js app
pnpm build:app

# 5. Check for overclaim content in docs
grep -R "mainnet.*live\|production relayer.*exists\|gasless payments.*implemented" \
  app/src/app/docs || echo "CLEAN"

# 6. List all docs routes
find app/src/app/docs -name "page.tsx" | sort

Filing an Issue

When reporting a bug or unexpected behaviour, please include the following information to help diagnose the issue quickly.

FieldWhat to include
Package version / commitRun `git log --oneline -1` and paste the commit hash
Browser & versione.g. Chrome 124, Firefox 126, Safari 17
Wallet networkSelected Stellar network β€” confirm in Freighter settings
Error messageFull error text from browser console or terminal
Stack traceCopy the full stack trace from DevTools console
txHash (if available)The Stellar transaction hash if the tx was submitted
RootSyncErrorIf thrown: include frontendRootHex and contractRootHex
Build command outputPaste output of `pnpm build:core && pnpm build:browser && pnpm build:react && pnpm build:app`
EnvironmentConfirm NEXT_PUBLIC_CONTRACT_ID and NEXT_PUBLIC_NETWORK_PASSPHRASE are set (redact values if needed)
β„Ή
Fluppy is a Testnet MVP. Please do not file security vulnerability reports publicly. Instead, contact the maintainer directly with a private disclosure. Include the contract ID, transaction hash (if any), and a minimal reproduction.