fix: stub @solana/web3.js in webpack (connector compat layer)

This commit is contained in:
thesn10
2026-06-25 12:00:30 +02:00
parent 96ba193cc4
commit fc0a4c96c1

View File

@@ -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