anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.46k stars 911 forks source link

WalletConnectButton disabled when deployed to production, but works in local development. #892

Closed bicced closed 4 months ago

bicced commented 5 months ago

Describe the bug

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.

github-actions[bot] commented 4 months ago

Hi @bicced,

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Wallet Adapter itself.

Questions like yours deserve a purpose-built Q & A forum. Unless there exists evidence that this is a bug with Wallet Adapter itself, please post your question to the Solana Stack Exchange using this link:

https://solana.stackexchange.com/questions/ask


This automated message is a result of having added the ‘question’ tag.