Docs Help
Troubleshooting
Symptoms, likely causes and fixes for common integration problems.
Start with the health check; it names the most common problems and says how to fix them:
import { checkBridgeHealth } from '@hydraone-sdk/core';
const report = await checkBridgeHealth(client);
console.log(report.summary);
Setup and connection
| Symptom | Likely cause | Fix |
|---|---|---|
init() rejects with ERR_NOT_IN_IFRAME | The page is a normal tab, so there is no host shell. | Open the app inside the HydraOne web client (an iframe). |
init() rejects with ERR_TIMEOUT ("Handshake ... timed out") | The host did not answer CLIENT_READY within handshakeTimeoutMs (3 s). | Check you are embedded in the right host, the hostOrigin is exact, and the host is running. Raise handshakeTimeoutMs on slow networks. |
ERR_BRIDGE_NOT_CONNECTED on a wallet call | init() has not finished, failed, or the client was destroyed. | await client.init() first, and create a new client after destroy(). |
ERR_INVALID_OPTIONS from the constructor | Neither transport nor hostOrigin was passed. | Pass hostOrigin, or a transport. |
ERR_INVALID_RESPONSE from signTx with mergeWitnesses: true | The wallet's witness set could not be merged into the transaction. | The user already signed: merge details.witnessSet with applyWitnessSet, or check the host's SIGN_TX answer. |
Origins and the iframe
| Symptom | Likely cause | Fix |
|---|---|---|
| Handshake times out although the host is running | hostOrigin does not match the sender's origin, or the message did not come from window.parent. Such messages are dropped silently. | Use the exact origin (scheme, host, port). Set checkIframeSource: false only for tests. |
Constructor throws "Wildcard origin ... not allowed in production" (ERR_UNTRUSTED_ORIGIN) | hostOrigin: '*' outside a known development or test environment. | Use the real origin. |
| Diagnostics: "Iframe sandbox is missing allow-same-origin" | The host iframe lacks the sandbox flag. | Add allow-scripts allow-same-origin to the iframe sandbox attribute. |
Wallet and signing
| Symptom | Likely cause | Fix |
|---|---|---|
ERR_USER_REJECTED | The user cancelled the wallet prompt. | Not an error condition; let the user try again. |
ERR_TIMEOUT on signTx | The user did not respond within signingTimeoutMs (2 min), or the host hung. | Raise it with { timeoutMs } per call or in the options. |
ERR_UNSUPPORTED_METHOD | The host does not implement the request (for example an older host without GET_REWARD_ADDRESSES). | Update the host, or handle the error and fall back. |
Addresses are addr1... where hex was expected | Address queries return bech32 by default since 0.2.0. | Pass { format: 'hex' }, or convert with addressToHex. |
Storage
| Symptom | Likely cause | Fix |
|---|---|---|
| Stored data is lost after reload on Safari | Storage was partitioned or wiped. | Use HostStorageRelayAdapter. See the Safari ITP guide. |
ERR_STORAGE_UNAVAILABLE | The host relay is unreachable or storage is blocked. | Verify the transport is connected, the host handles HOST_STORAGE_* messages, and the iframe sandbox. |
Frameworks and types
| Symptom | Likely cause | Fix |
|---|---|---|
| Hydration mismatch in Next.js or Nuxt | Wallet data renders on the server as empty and on the client as filled. | Render a neutral state until isConnected is true, or use <ClientOnly>. |
Types not found under moduleResolution: node | Old resolution mode ignores exports. | Use bundler, node16 or nodenext. |
Still stuck?
Turn on debug: true with a logger, run the health check, and open an issue with the report (remove addresses and tokens first). See SUPPORT.md.
