This guide covers migrating between Vue Solana versions. There are three major migrations: upgrading from v3 to v4 (latest), v2 to v3, and migrating from v1.x to v2.
Migration: v3 to v4
v4.0.0 is the latest release. It trims bundle size by removing heavy modules from the @vue-solana/core root barrel and ships smaller tarballs. It also changes a few composable APIs and honors the configured commitment.
What's Changed
- Root barrel trimmed:
@vue-solana/coreno longer re-exportsBuffer/installSolanaBufferPolyfill,ios-wallet, ormobile-walletfrom its root barrel. Use the dedicated subpaths instead. - Smaller tarballs:
.d.mtsdeclaration files are no longer shipped; everyexportscondition points at.d.ts. useSignatureStatus: no longer accepts acommitmentoption.commitmenthonored:createSolanaClient()/createSolanaPlugin()/ Nuxtsolana.commitmentis now actually applied to RPC calls.plugin.dispose():createSolanaPlugin()now returnsdispose().- Airdrop failures typed:
useAirdrop()failures areSolanaErrors with codeRPC_FAILURE. bufferoptional peer: apps usingbuffer-polyfillmust installbufferthemselves.bs58removed: apps importingbs58directly must add it to their own dependencies.- New auto-imports (Nuxt):
useSolanaClientCapability(),tryUseSolana(),clearSwrCache(),deleteSwrKey(). - New
deleteSwrKey()in@vue-solana/vue/swr.
How to Migrate
1. Update Dependencies
pnpm add @vue-solana/vue@^4.0.0
# or
pnpm add @vue-solana/nuxt@^4.0.0
If you use buffer-polyfill, install buffer yourself:
pnpm add buffer
If you import bs58 directly, add it:
pnpm add bs58
2. Update Buffer / Wallet Imports
- import { Buffer, installSolanaBufferPolyfill } from "@vue-solana/core";
+ import { Buffer, installSolanaBufferPolyfill } from "@vue-solana/core/buffer-polyfill";
- import { getSolanaIosWallets } from "@vue-solana/core";
+ import { getSolanaIosWallets } from "@vue-solana/core/ios-wallet";
- import { registerSolanaMobileWallet } from "@vue-solana/core";
+ import { registerSolanaMobileWallet } from "@vue-solana/core/mobile-wallet";
(@vue-solana/vue/buffer-polyfill and @vue-solana/nuxt/buffer-polyfill are unchanged.)
3. Update useSignatureStatus
- useSignatureStatus(signature, { commitment: "confirmed" })
+ useSignatureStatus(signature)
For per-call commitment, pass { commitment } to confirm(signature, opts) from useTransactionConfirmation(), or call confirmTransactionSignature() directly from @vue-solana/core.
4. Dispose Plugins in Plain Vue
const solana = createSolanaPlugin();
createApp(App).use(solana);
// on teardown:
app.unmount();
solana.dispose();
(Nuxt wires this automatically.)
5. Handle Typed Airdrop Errors
useAirdrop() failures are now SolanaErrors with code RPC_FAILURE; the original error is preserved as cause.
import { isSolanaError } from "@vue-solana/core/kit";
try {
await airdrop();
} catch (error) {
if (isSolanaError(error, "RPC_FAILURE")) {
// handle
}
}
Migration: v2 to v3
v3.0.0 is the latest release. It changes the module format to ESM-only and makes the kit subpaths a complete mirror of @solana/kit. The Kit migration itself is already complete in v2, so v3 focuses on packaging and minor behavioral changes.
What's Changed
- ESM only: All
@vue-solana/*packages now ship ESM only. Therequireexport condition and top-levelmainfield were removed. - Complete Kit mirror:
@vue-solana/core/kit,@vue-solana/vue/kit, and@vue-solana/nuxt/kitnowexport *from@solana/kit(not a curated subset). - Read composable behavior:
useBalance(),useAccountInfo(),useProgramAccounts(),useTokenAccounts(), anduseTokenBalance()(and theiruseSolana*Nuxt equivalents) share a unified state machine with improved error handling. - Dependency surface: You no longer need to add
@solana/kitto your ownpackage.jsonwhen using the package'skitsubpaths.
How to Migrate
1. Update Dependencies
# For Vue apps
pnpm add @vue-solana/vue@^3.0.0
# For Nuxt apps
pnpm add @vue-solana/nuxt@^3.0.0
2. Handle ESM-Only Packages
If your app or scripts still use CommonJS (require()), convert to ESM. Add "type": "module" to your package.json or rename files to .mjs.
// Instead of require()
import { createSolanaClient } from "@vue-solana/core/kit";
If you cannot switch to ESM, stay on @vue-solana/*@^2.x which still ships .cjs builds.
3. Update Kit Imports
With the full mirror, import everything from the package's kit subpath. If you previously added @solana/kit to your dependencies, you can remove it.
// Vue
import { address, lamports } from "@vue-solana/vue/kit";
import type { Address } from "@vue-solana/vue/kit";
// Nuxt (auto-imported composables still work)
import { address, lamports } from "@vue-solana/nuxt/kit";
Note: Four names (SolanaError, SolanaErrorCode, isSolanaError, TransactionStatus) are resolved differently between root barrels and /kit subpaths. If you're catching errors thrown by Kit, import isSolanaError from the kit subpath.
import { isSolanaError } from "@vue-solana/core/kit";
try {
await client.rpc.getBalance(account).send();
} catch (error) {
if (isSolanaError(error, "RPC_HTTP_ERROR")) {
// ...
}
}
4. Update Error Handling for Read Composables
refresh() now rejects on failure (instead of resolving). Update code that awaits it:
await refresh().catch(() => undefined);
Template @click="refresh" is unaffected.
When reads fail, data resets to its empty value. Check error explicitly:
<template>
<UAlert v-if="error" color="error" variant="subtle" title="Could not load the balance." />
<p v-else>Lamports: {{ balance ?? "—" }}</p>
</template>
useTokenBalance()'s balance and decimals are read-only computed refs - remove any assignments to them.
5. Remove Legacy Web3 Imports
Remove any remaining @vue-solana/*/web3 imports and @solana/web3-compat dependencies (they don't exist in v3).
Migration: v1.x to v2.0.0
Vue Solana v2.0.0 moved from @solana/web3-compat to @solana/kit as the core API surface. This is a breaking change for apps on v1.x.
What's Changed
- Kit-only API:
@solana/web3-compatis removed from all packages. The context no longer carriesconnection, andweb3subpaths are deleted. - Type changes:
SolanaWallet.publicKeyis now a plain base58Addressstring (not aPublicKeyclass). - Composable changes:
useConnection()was replaced byuseSolanaClient().useRpc()now returns cluster state plus the injected Kit client. - Numeric types: RPC results like lamports, slots, and block heights are
bigint. Account data isUint8Arrayrather thanBufferin normalized composable outputs. - Transaction surface: Helpers like
signAndSendTransactionandconfirmTransactionSignaturenow take a Kit client instead of aConnection, and transaction inputs use Kit types.
How to Migrate
1. Update Dependencies
pnpm add @vue-solana/vue@^2.0.0
# or
pnpm add @vue-solana/nuxt@^2.0.0
Remove @solana/web3-compat from your dependencies if present.
2. Update API Calls
| Legacy | Replacement |
|---|---|
Connection, new Connection(url) | client.rpc from createSolanaClient({ endpoint }) / useSolanaClient() |
PublicKey, new PublicKey(s), .toBase58() | Address via address(s) |
Keypair, keypair.publicKey | generateKeyPairSigner() from @vue-solana/*/kit; signer .address |
SystemProgram.transfer | getTransferSolInstruction from @solana-program/system |
LAMPORTS_PER_SOL math | lamports() from @vue-solana/*/kit |
sendAndConfirmTransaction | Use Kit transaction planning; for wallet-signed flows use signAndSendTransaction(client, ...) |
requestAirdrop (devnet) | client.airdrop() |
connection.getBalance | client.rpc.getBalance(...).send() (returns bigint) |
connection.confirmTransaction / getSignatureStatuses | confirmTransactionSignature(client, ...) |
useConnection() | useSolanaClient() |
parsePublicKey(value) | parseAddress(value) from @vue-solana/core/address |
3. Update Code Examples
import { useSolanaClient } from "@vue-solana/vue/useSolanaClient";
import { address } from "@vue-solana/vue/kit";
const { client } = useSolanaClient();
const lamports = await client.rpc.getBalance(address("...")).send();
4. Clean Up
Remove all imports from @vue-solana/*/web3, remove @solana/web3-compat from package.json, and delete any local .d.ts shims you added for web3-compat. Also remove buffer-polyfill if you only needed it for legacy web3-compat transaction paths.
Notes
- The Kit
client.rpcuses per-call defaults forcommitmentrather than the config value. Passcommitmentexplicitly if needed:rpc.getBalance(account, { commitment: "confirmed" }).send(). - For framework-agnostic code, use
createSolanaClient()from@vue-solana/core/kit.