1

I have created a web app using react and https://github.com/solana-labs/wallet-adapter. This works fine with the desktop wallet adapters, but I would like to use the mobile wallet adapters also so I can use the app on mobile.

So first, I install the npm package for the mobile adapter using;

npm i @solana-mobile/wallet-adapter-mobile

And then attempt to import the adapter using;

import { createDefaultAuthorizationResultCache, SolanaMobileWalletAdapter } from '@solana-mobile/wallet-adapter-mobile';

This is fine on it's own, So then I try to add the wallet to the wallets list with;

   const wallets = useMemo(
        () => [
            new SolanaMobileWalletAdapter({
                appIdentity: { name: 'Solana Wallet Adapter App' },
                authorizationResultCache: createDefaultAuthorizationResultCache(),
            }),
            new CoinbaseWalletAdapter(),
            new PhantomWalletAdapter(),
            new GlowWalletAdapter(),
            new SlopeWalletAdapter(),
            new SolflareWalletAdapter({ network }),
            new TorusWalletAdapter(),
        ],
        [network]
    );

And I get the following errors;

Field 'browser' doesn't contain a valid alias configuration
              C:\Users\brook\Documents\repos\testapp\node_modules\@solana-mobile\wallet-adapter-mobile.tsx doesn't exist

...

Module not found: Error: Can't resolve '@solana-mobile/wallet-adapter-mobile' in 'C:\Users\brook\Documents\repos\testapp\src\components'

Where src/components is the folder that includes Wallets.tsx where this code is written.

See the image for what the node module has actually installed, I am not sure I am missing a step in installing the module?

Screenshot of nodemodule

Node Version: v14.15.0 v16.16.0 (Updating to latest node does not help)

3
  • Tried upgrading Node? Per nodejs.org, Latest LTS Version: 16.16.0 (includes npm 8.11.0)
    – MmmHmm
    Jul 22, 2022 at 20:24
  • 1
    Hey @MmmHmm. Updated to 16.16.0 and reinstalled wallet-adapter-mobile module and it has not helped. Will update question to reflect.
    – Brooklyn
    Jul 22, 2022 at 20:35
  • 1
    I’m voting to close this question because it's almost certainly a configuration issue with Webpack. See stackoverflow.com/a/69302447/802047. Jul 29, 2022 at 23:11

0