diff --git a/app/next.config.ts b/app/next.config.ts index a9885b6..6097e95 100644 --- a/app/next.config.ts +++ b/app/next.config.ts @@ -3,6 +3,17 @@ import type { NextConfig } from 'next' const config: NextConfig = { reactStrictMode: true, transpilePackages: ['@solana/connector'], + // @solana/connector bundles a web3.js v1 compat layer for legacy wallets. + // We never pass web3.js Transaction objects (we use @solana/kit / Uint8Array), + // so this code path is dead. Stub the module so webpack doesn't error at build + // time when it can't resolve the optional dynamic import('@solana/web3.js'). + webpack: (webpackConfig) => { + webpackConfig.resolve.fallback = { + ...webpackConfig.resolve.fallback, + '@solana/web3.js': false, + } + return webpackConfig + }, } export default config