Git Product home page Git Product logo

Comments (16)

ranlix avatar ranlix commented on July 20, 2024 1

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.

o-az avatar o-az commented on July 20, 2024

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.
CleanShot 2022-02-23 at 09 42 04

from wagmi.

tmm avatar tmm commented on July 20, 2024

Spent some time looking into it. Seems related to the WalletConnectConnector (most likely one of it's dependencies, like @walletconnect/ethereum-provider).

from wagmi.

csadai avatar csadai commented on July 20, 2024

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.

tmm avatar tmm commented on July 20, 2024

What version of JavaScript are you targeting? (If you are using TypeScript, it's the target field in tsconfig.json.)

from wagmi.

cnasc avatar cnasc commented on July 20, 2024

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.

tmm avatar tmm commented on July 20, 2024

@cnasc I just upgraded the wagmi docs site to [email protected] and [email protected] with no build problems.

from wagmi.

ranlix avatar ranlix commented on July 20, 2024

What version of JavaScript are you targeting? (If you are using TypeScript, it's the target field in tsconfig.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 avatar cnasc commented on July 20, 2024

@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.

tmm avatar tmm commented on July 20, 2024

@liran319 can you try with the latest version 0.2.22?

from wagmi.

cnasc avatar cnasc commented on July 20, 2024

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.

csadai avatar csadai commented on July 20, 2024

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.

tmm avatar tmm commented on July 20, 2024

@csadai can you try now?

from wagmi.

csadai avatar csadai commented on July 20, 2024

Hi @tmm Sorry I didn't sync my comment from #288. It works indeed, thanks a lot for fixing.

from wagmi.

tmm avatar tmm commented on July 20, 2024

@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.

github-actions avatar github-actions commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.