From fc0a4c96c1d414f15218871a47995c9237f3d693 Mon Sep 17 00:00:00 2001 From: thesn10 <38666407+thesn10@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:00:30 +0200 Subject: [PATCH] fix: stub @solana/web3.js in webpack (connector compat layer) --- app/next.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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