Closed aslaker closed 2 years ago
same issue for me
Please check out the starter project provided for Next: https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/nextjs-starter
I just tested this today, so I know it works. You can drag that directory out of the repo, run npm install
and npm run dev
and it should work.
I could fix it by transpiling modules.. Just put it in next.config.js `/* @type {import('next').NextConfig} / const withTM = require('next-transpile-modules')([ '@solana/wallet-adapter-react', '@solana/wallet-adapter-base', '@solana/wallet-adapter-wallets', '@solana/wallet-adapter-react-ui', '@solana/wallet-adapter-react-ui', '@solana-mobile/wallet-adapter-mobile', '@solana/wallet-adapter-bitkeep', '@solana/wallet-adapter-bitpie', '@solana/wallet-adapter-blocto', '@solana/wallet-adapter-brave', '@solana/wallet-adapter-clover', '@solana/wallet-adapter-coin98', '@solana/wallet-adapter-coinbase', '@solana/wallet-adapter-avana', '@solana/wallet-adapter-coinhub', '@solana/wallet-adapter-exodus', '@solana/wallet-adapter-glow', '@solana/wallet-adapter-huobi', '@solana/wallet-adapter-krystal', '@solana/wallet-adapter-particle', '@solana/wallet-adapter-hyperpay', '@solana/wallet-adapter-ledger', '@solana/wallet-adapter-mathwallet', '@solana/wallet-adapter-neko', '@solana/wallet-adapter-nightly', '@solana/wallet-adapter-salmon', '@solana/wallet-adapter-strike', '@solana/wallet-adapter-nufi', '@solana/wallet-adapter-phantom', '@solana/wallet-adapter-tokenary', '@solana/wallet-adapter-safepal', '@solana/wallet-adapter-saifu', '@solana/wallet-adapter-sky', '@solana/wallet-adapter-slope', '@solana/wallet-adapter-sollet', '@solana/wallet-adapter-solflare', '@solana/wallet-adapter-solong', '@solana/wallet-adapter-spot', '@solana/wallet-adapter-tokenpocket', '@solana/wallet-adapter-torus', '@solana/wallet-adapter-trust', '@solana/wallet-adapter-backpack', '@solana/wallet-adapter-fake', '@solana/wallet-adapter-keystone', '@solana/wallet-adapter-walletconnect' ]);
const nextConfig = { reactStrictMode: true, swcMinify: true, experimental: { images: { allowFutureImage: true } }, output: 'standalone', productionBrowserSourceMaps: true, }
module.exports = withTM(nextConfig);`
Transpiring modules shouldn't be required (the starter project doesn't do this). But glad you found something that worked! I'm going to close this since it's a build config issue.
@jordansexton the starter project does not work.. same issue
Dropping by to say I'm having the same issue. I can even redeploy prior working builds of my project and hit the same failure. Last working deploy seems to be on Tuesday Aug 16.
Haven't been able to find many other leads and no build changes on my end since then.
@jordansexton I'm not sure this solves my problem though. I won't always be starting with your starter project, so I need to have a way to add the wallet to an existing project. In addition, the starter project that you have extends tsconfig files that include relative paths to your root project, which makes it harder to pull it out of your project and use it as is.
I guess I just want to get an understanding of what the issue is. Is it a dependency problem, is it a typescript problem? VsCode finds the ConnectionProvider fine, but it seems like there is an issue with the export in the esm
file. It looks like someone else opened up a ticket for this as well about 4 hours ago.
I'll hop in and take a look today to see if there is anything I can find, and open a PR for.
@jordansexton
The starter project also doesn't work outside of monorepo.
I just removed pnpm-workspace.yaml
and tried building a starter project. And then I got errors.
Reopened, but can you thread replies in #532?
I have a starter setup with NextJS and tRPC for my backend logic. I haven't added many libraries except for ChakraUI. I have added the quick start code for the solana-labs/wallet-adapter, but ran into this issue when trying to start the application. I have also added all of the libraries mentioned in the README for the wallet adapter.
To Reproduce Steps to reproduce the behavior: Start the application with a basic setup
Expected behavior The application should start up with no error
Screenshots
Desktop (please complete the following information):
Additional context Below is the
_app.tsx
file I am using.