Comments (7)
Hmm, interesting. What about using the IgnorePlugin for Webpack in the Next.js config to ignore the file, then import it manually?
from wallet-adapter.
Wasn't able to get anything going with the ignore plugin or babel but I think this library does the trick
https://github.com/martpie/next-transpile-modules
added to the next.config.js file:
const withTM = require('next-transpile-modules')(['@solana/wallet-adapter-react-ui']);
module.exports = (_, { defaultConfig }) => {
// Next.js config
const nextConfig = {
...defaultConfig,
reactStrictMode: true,
};
return withTM(nextConfig);
};
from wallet-adapter.
Oh, this is what the Next.js starter project already does: https://github.com/solana-labs/wallet-adapter/blob/2c29262405f971f950563f2ff229c1a7a2ff2582/packages/starter/nextjs-starter/next.config.js#L2
from wallet-adapter.
Since the React UI package is already being transpiled this way, I'll close this issue:
https://github.com/solana-labs/wallet-adapter/blob/2c29262405f971f950563f2ff229c1a7a2ff2582/packages/starter/nextjs-starter/next.config.js#L11
from wallet-adapter.
Wallets
is undefined when transpiling those modules. Here's my next config where I'm transpiling the modules.
node_modules/@solana/wallet-adapter-ant-design/lib/WalletModal.js (25:25) @ WalletModal TypeError: Cannot read property 'map' of undefined
/** @type {import('next').NextConfig} */
const withTM = require('next-transpile-modules')([
'@solana/wallet-adapter-react',
'@solana/wallet-adapter-base',
'@solana/wallet-adapter-ant-design',
'@solana/wallet-adapter-wallets',
'@solana/wallet-adapter-react',
]);
module.exports = withTM({
reactStrictMode: true,
webpack: (config) => {
config.resolve.fallback = { fs: false, path: false, os: false };
return config;
},
});
from wallet-adapter.
Please check https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/example which has a complete example of using every provided UI framework for React with Next.js, and also shows how to import the styles and the Next config setup needed.
from wallet-adapter.
For next 13, sprinkling a little "use client" at the top of the file did it for me :)
from wallet-adapter.
Related Issues (20)
- Phantom wallet cannot be detected
- When any wallet is not installed, users can be guided to install it
- onAccountChange is not able to listen when phantom wallet account changed HOT 1
- Coinabase Wallet transaction on Solana DevNet is failing
- Idk
- localstorage sometimes behaves strangely HOT 2
- sendTransaction doesn't work with String data HOT 1
- Sending SPL token using getOrCreateAssociatedTokenAccount wallets without the token doesn't work HOT 2
- Request blocked Warning from phantom wallet HOT 1
- I can't get the wallet to open to initiate a transaction. HOT 5
- Error: Hydration failed because the initial UI does not match what was rendered on the server. HOT 2
- WalletSignTransactionError: Reached end of buffer unexpectedly HOT 1
- Detailed error messages on transaction sending HOT 2
- TrustWallet - Cannot read properties of undefined (reading "serialize") HOT 1
- 500 ERROR When selecting wallet on ios mobile devices HOT 1
- Feature: disable auto-detect for wallets HOT 2
- Wallet -adapter issue for Math wallet
- Add OKX wallet adapter HOT 12
- error :./scripts/cargo-install-all.sh . HOT 1
- More hooks HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wallet-adapter.