Frequently Asked Questions
Common questions and solutions for build issues, authentication, transactions, and debugging with the TypeScript SDK.Build & Bundler Issues
"Buffer is not defined" or "process is not defined"
"Buffer is not defined" or "process is not defined"
Modern bundlers don’t include Node.js polyfills by default.Vite:Next.js / Create React App:
"crypto is not defined"
"crypto is not defined"
Add global polyfill to your bundler config:
Module resolution issues or type errors
Module resolution issues or type errors
Ensure
tsconfig.json uses modern module resolution:Next.js: "Cannot find module" or ESM errors
Next.js: "Cannot find module" or ESM errors
Import from modular packages instead of the umbrella SDK:If you see elliptic package errors, add to
next.config.js:Bundle size is too large
Bundle size is too large
Import modular packages instead of the umbrella package:
Authentication
"Redirect URI mismatch" error
"Redirect URI mismatch" error
The
redirectUri in your code must exactly match what’s configured in Hub.Common mismatches:httpvshttps- Trailing slash (
/callbackvs/callback/) - Port number differences
- Different paths
"Invalid client_id" error
"Invalid client_id" error
Verify the following:
clientIdmatches your Hub configuration- You’re using the correct environment (Sandbox vs Production)
publishableKeyis set correctly
"Popup blocked" when logging in
"Popup blocked" when logging in
Browsers block popups that aren’t triggered by user interaction.
Callback page shows error or nothing happens
Callback page shows error or nothing happens
Ensure
loginCallback() is called on your redirect URI page:What regions are supported?
What regions are supported?
Passport is globally available, except for OFAC-sanctioned regions. Users in sanctioned regions will be blocked from authentication.See Magic’s supported regions for details.
Transactions
"User rejected the request"
"User rejected the request"
User cancelled the transaction in the Passport popup. Handle this gracefully:
"Insufficient funds" error
"Insufficient funds" error
The user doesn’t have enough IMX for the transaction + gas fees.Direct users to fund their wallet via the Checkout widgets.
"Nonce too low" error
"Nonce too low" error
Usually caused by pending transactions. Wait for pending transactions to confirm:
Performance
Slow SDK initialization
Slow SDK initialization
Initialize once and reuse the instance:
Debugging
How do I enable SDK debug logs?
How do I enable SDK debug logs?
Enable debug logs in the browser console:Then refresh the page to see SDK debug output.
How do I inspect SDK network calls?
How do I inspect SDK network calls?
SDK calls go to:
- Sandbox:
api.sandbox.immutable.com - Production:
api.immutable.com
Common HTTP error codes
Common HTTP error codes
| Code | Meaning | Solution |
|---|---|---|
| 401 | Unauthorized | Check API key or access token |
| 403 | Forbidden | Check permissions in Hub |
| 429 | Rate limited | Implement exponential backoff |
| 500 | Server error | Retry with backoff, contact support if persistent |