@solana/wallet-adapter-react-ui WalletConnectButton Disabled in Production with Vite

139 views Asked by At

I'm using @solana/wallet-adapter-react-ui in my React application for Solana wallet integration. The WalletConnectButton works as expected in my local development environment, but when I deploy the application to production, the button is disabled.

This behavior is similar to what happens when a browser does not have a compatible wallet extension installed, but in this case, I have confirmed that the extension is installed and functioning in the browser.

I'm wondering if this issue could be related to my Vite build configuration, as this is one of the main differences between my local and production environments.

Here's my current Vite config:

import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig({
  plugins: [nodePolyfills({include: ['stream'], globals: {Buffer: true, process: true}})],
  build: {
    rollupOptions: {
      plugins: [
        nodePolyfills({
          include: ['stream'],
          globals: {
            Buffer: true,
            process: true,
          }
        })
      ]
    }
  }
});

Additional Details:

  • The application is deployed on firebase hosting

  • No relevant errors are shown in the browser console in production.

Has anyone encountered a similar issue or can provide insights into what might be causing this behavior? Any suggestions on how to debug or fix this issue would be greatly appreciated.

0

There are 0 answers