fix: stub @solana/web3.js in webpack (connector compat layer)
This commit is contained in:
@@ -3,6 +3,17 @@ import type { NextConfig } from 'next'
|
|||||||
const config: NextConfig = {
|
const config: NextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
transpilePackages: ['@solana/connector'],
|
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
|
export default config
|
||||||
|
|||||||
Reference in New Issue
Block a user