Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wagmi generate stuck #3952

Closed
1 task done
oxSaturn opened this issue May 20, 2024 · 7 comments
Closed
1 task done

wagmi generate stuck #3952

oxSaturn opened this issue May 20, 2024 · 7 comments
Labels
Needs Reproduction Misc: Needs Reproduction

Comments

@oxSaturn
Copy link
Contributor

Describe the bug

I'm working on upgrading a wagmi v1 project to v2, but ran into this issue as below:

image

As you can see,wagmi generate command was stuck there forever.

So I just modified the cli code to see if I can find something wrong:

Screenshot-eFw46A6B@2x

Here's the result of running wagmi generate:

✔ Validating plugins
✔ Resolving contracts
✔ Running plugins
✔ Writing to ./lib/wagmiGen.ts
Done

Obviously, the generate function proceeded without any problem.

I'm not sure what's going on here.

I can insert a process.exit(0) right after the await generate(options):

Screenshot-jRlPK5Mo@2x

Then everything would work as expected, but I'm not sure it's the right fix.

I'm wondering if anyone ran into this problem? And how did you solve it? Or it would be a bug?

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

Wagmi Version

latest

Viem Version

latest

TypeScript Version

^5.4.5

Check existing issues

Anything else?

No response

@oxSaturn
Copy link
Contributor Author

Ok, here's what I found with process._getActiveHandles():

Screenshot-UTdOkukV@2x

Seems websocket is open somewhere due to walletconnect when running wagmi generate command:

Screenshot-DXcpGQdD@2x

@tmm tmm added the Needs Reproduction Misc: Needs Reproduction label May 20, 2024
Copy link
Contributor

Hello @oxSaturn.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config & environment, and trying to reproduce your issue. See Why reproductions are required.

Please reopen this issue when a reproduction is added.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@oxSaturn
Copy link
Contributor Author

oxSaturn commented May 23, 2024

@tmm Hey, sorry about the haste issue without a reproduction, it's a huge project and took me a while to figure out what's going on, and here's the reproducible repository you can check out and run wagmi generate to reproduce.

https://github.com/oxSaturn/wagmi-generate-bug

Screenshot-BO61KBFX@2x

The culprit is I'm importing a variable from constants which would be used in _app.tsx as well, obviously it's triggering the walletconnect to connect without close, hence hang wagmi generate command.

And I believe we didn't have such issue with wagmi v1 + viem v1 + rainbowkit v1.

@tmm
Copy link
Member

tmm commented May 23, 2024

Is this only reproducible when you are using RainbowKit?

@oxSaturn
Copy link
Contributor Author

oxSaturn commented May 23, 2024

Is this only reproducible when you are using RainbowKit?

Just pushed another commit to test without rainbowkit, obviously it's still reproducible with the walletConnect connector from wagmi.

The projectId from the wagmi documetation isn't valid, so please replace it with a valid one to test.

@oxSaturn
Copy link
Contributor Author

@tmm Can you reproduce it with my repository? If so, can you please reopen this issue?

Copy link
Contributor

github-actions bot commented Jun 9, 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 questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs Reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants