Comments (16)
OH yes, it is! It works!
But I think there is some where can be optimized and fixed on wagmi
.
Thanks you very much!
from wagmi.
A possible solution: can you try removing swcMinify
setting in your next.config.js
file? I had the same issue that went away when I removed swcMinify
setting.
from wagmi.
Spent some time looking into it. Seems related to the WalletConnectConnector
(most likely one of it's dependencies, like @walletconnect/ethereum-provider
).
from wagmi.
Maybe related: I just upgraded to 0.2.17
and the app won't launch.
The error message Unhandled Runtime Error SyntaxError: Unexpected private name #switchChain. Cannot parse class method with private name.
My swcMinify
is at false
.
If I remove the WalletConnectConnector
from my connectors, it works. There really seems to be a problem there.
from wagmi.
What version of JavaScript are you targeting? (If you are using TypeScript, it's the target
field in tsconfig.json
.)
from wagmi.
Also on Next (12.1.0), using [email protected]
. Found a similar issue with failures only happening in prod builds. Minimal reproduction is just importing Provider
from wagmi.
In this case the message I get is:
TypeError: Cannot read properties of undefined (reading 'map')
in Chromium and TypeError: i is undefined
in Firefox. Unfortunately can't tell the context from the linked minified code.
I've tried going back a few versions (0.2.13 and 0.2.10) because it sounded like this worked for people on Next in the past, but same result there.
from wagmi.
@cnasc I just upgraded the wagmi docs site to [email protected]
and [email protected]
with no build problems.
from wagmi.
What version of JavaScript are you targeting? (If you are using TypeScript, it's the
target
field intsconfig.json
.)
Hi there,
https://github.com/liran319/next-wagmi-demo/blob/main/tsconfig.json
You can check the version in this repo here.
from wagmi.
@cnasc I just upgraded the wagmi docs site to
[email protected]
and[email protected]
with no build problems.
🤔 odd. Tried 0.2.18
just in case but same result. Looking at the docs site source, I don't see any difference in build config or anything. I copied https://github.com/tmm/wagmi/blob/main/docs/components/core/Providers.tsx directly just in case there was something wrong with the way I'd written it myself, but no difference.
Will have to dig deeper into the Next side of things to figure it out I think
from wagmi.
@liran319 can you try with the latest version 0.2.22
?
from wagmi.
can you try with the latest version
0.2.22
?
On my end, 0.2.22
no longer breaks in a prod build on my app (when just importing Provider
). Awesome to see, going to try integrating fully this week
from wagmi.
Mine still breaks on Safari (version 14.1.2). It fails on this Webkit line https://github.com/WebKit/webkit/blob/main/Source/JavaScriptCore/parser/Parser.cpp#L3039
Exact error:
Unhandled Runtime Error
SyntaxError: Unexpected private name #switchChain. Cannot parse class method with private name.
Call Stack
eval
[native code]
./node_modules/wagmi-core/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js
My set up:
"wagmi": {
"version": "0.2.22",
"resolved": "https://registry.npmjs.org/wagmi/-/wagmi-0.2.22.tgz",
"integrity": "sha512-WtpRO/JGTIrcs9vBdIJZe...",
"requires": {
"@ethersproject/providers": "^5.5.1",
"@walletconnect/ethereum-provider": "1.7.5",
"wagmi-core": "0.1.16",
"walletlink": "^2.5.0"
}
},
Note: If I remove WalletConnect from my config, it works.
new WalletConnectConnector({
options: {
infuraId,
qrcode: true,
},
}),
from wagmi.
@csadai can you try now?
from wagmi.
Hi @tmm Sorry I didn't sync my comment from #288. It works indeed, thanks a lot for fixing.
from wagmi.
@liran319 this appears to be an issue with next's SWC minification. You can add feedback to this discussion vercel/next.js#30237
the other issue brought up in the thread is related to es6 private fields. that is now fixed.
from wagmi.
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.
from wagmi.
Related Issues (20)
- Foundry Plugin Error - Contract Name "IERC721TokenReceiver" Must Be Unique HOT 1
- `wagmi generate` stuck HOT 6
- Playground SSR example will throw "ChainNotConfiguredError: Chain not configured." HOT 1
- Playground code won't build, prevents users from creating minimal reproduction for server side issues with wagmi HOT 3
- Update your SIWE example code to support 1271 HOT 2
- Unable to disconnect wallet correctly by useDisconnect hook HOT 4
- Safe Connector causes wagmi account to be stuck in connecting state HOT 1
- Wallet Connect connector missing client HOT 2
- Error: 'wagmi' provider is missing. Ensure that 'wagmi' hooks are used within the context of a 'wagmi' provider in the npm package. HOT 3
- An error occurred when attempting to switch chain HOT 2
- test issue label workflow HOT 4
- autoimport Nuxt eventemitter3 does not provide an export named 'default' HOT 6
- Value type incorrectly inferred for payable function as `undefined` HOT 3
- Coinbase connector - doesn't disconnect when EIP-6963 is active HOT 5
- Mismatch between processing of typed data when signing and verifying HOT 3
- globalThis is not defined HOT 5
- Typescript inference error on writeContractAsync. HOT 2
- Special contract address does not send requests HOT 4
- Connector fails to update chain after wallet chain switch and page refresh HOT 4
- Latest connector updates break build on vercel with next 14 node 20.x HOT 3
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 wagmi.