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.
Jump to section
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 foundCausebuild: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 mismatchCausetsconfig.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:appEnvironment Issues
[Stellar] NEXT_PUBLIC_CONTRACT_ID is requiredCause.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 missingCauseNEXT_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 rejectsCauseNEXT_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 valueCauseNext.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 2015Wallet / Freighter Issues
[useFluppyWallet] Freighter returned no addressCauseFreighter 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 deniedCauseUser clicked Reject in the Freighter access popup.
FixCall `connect()` again and have the user click Approve in the Freighter popup.
Transaction rejected / signing failedCauseUser 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 feeCauseTestnet 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 balanceCauseThe 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 IndexedDBCauseNo 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 credentialCauseThe 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 backupCauseThe 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 tabCauseDeveloper 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-proofCauseThe commitment was never enrolled, or was enrolled to a different backend instance.
FixCall `enrollCommitment(secret)` before calling `getMerkleProof(secret)`.
RootSyncError: frontendRootHex !== contractRootHexCauseThe 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 enrollmentsCauseThe 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 pathCauseCommitment 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 artifactCauseCircuit 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 progressCausegenerateZkProof() 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 generationCauseThe 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 FAILEDCauseThe 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 proofCauseGroth16 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 β NullifierSpentCauseThis 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: ChainIdMismatchCauseThe 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: WrongMerkleRootCauseThe 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: RecipientMismatchCauseThe 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: InvalidPaymentAmountCauseThe 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 β ContractPausedCauseThe 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 failedCauseSimulation 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 treeCauseA Fluppy hook was called outside of a FluppyProvider subtree.
FixWrap the component tree with
<FluppyProvider config={...}>. See Provider setup.FluppyProvider: stellarConfig or networkPassphrase missingCauseThe 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 useStateCauseDeveloper 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 mountCauseThe 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 SSRCauseBrowser-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 idleCausepay() 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" | sortFiling an Issue
When reporting a bug or unexpected behaviour, please include the following information to help diagnose the issue quickly.
| Field | What to include |
|---|---|
| Package version / commit | Run `git log --oneline -1` and paste the commit hash |
| Browser & version | e.g. Chrome 124, Firefox 126, Safari 17 |
| Wallet network | Selected Stellar network β confirm in Freighter settings |
| Error message | Full error text from browser console or terminal |
| Stack trace | Copy the full stack trace from DevTools console |
| txHash (if available) | The Stellar transaction hash if the tx was submitted |
| RootSyncError | If thrown: include frontendRootHex and contractRootHex |
| Build command output | Paste output of `pnpm build:core && pnpm build:browser && pnpm build:react && pnpm build:app` |
| Environment | Confirm 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.