-
Notifications
You must be signed in to change notification settings - Fork 797
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
feat: bundler module resolution #885
Conversation
Thanks @rin-st !
Yup it seems to work fine for me in both vscode and neovim. But when I update the typescript to 5.5.3, it seems to break again :( To reproduce:
yarn workspace @se-2/nextjs up typescript
yarn next:check-types Umm, we could merge this already but I am bit skeptical because of above thing and also on this branch when I hover over "viem/node_modules/abitype" in
See how on |
I don't know why, but extending Possible solution is to rewrite As I remember we added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible solution is to rewrite Address type directly, not through Register. It works, but am I missing something? Do we really need to use Register. Also updated TS version and looks like everything works fine.
Actually it was suggested in abitype docs: https://abitype.dev/config#overview
also while digging I found this in their release logs:
Maybe this was the reason Register
were not working?
As I remember we added string because it will be easier to work with our components to newcomers, am I right? Another solution is to remove abi.d.ts and add some as 0x${string}`, but we need to think if it really helps or not
Yup yup mainly for newcomers. here is the OG discussion : #515
But your current approach seems to works nicely, also tried deploying to vercel and works nicely too.
I think with this approach the problem will reappear again in future when viem / wagmi internal abitype version deviates from our abitype
version? But since we have locked the version, I think we can only encounter it while manually trying to update the viem / wagmi.
We can merge this though since currently everything works and its required for scaffold-eth/create-eth-extensions#11. Just cc @carletex once.
Thanks Shiv, yes! 🙏 After update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Shiv, yes! 🙏 After update
abitype
to1.0.5
problem disappeared, so I switched toRegister
again. There were no errors but for being more confident I also updatedwagmi
/viem
to latest versions
Noicce! Yup also updating wagmi / viem make sense just to be sure.
All in all, I think everything looks great and works fine!!
- We are using suggested way to update addressType using
Register
- Deploys to vercel nicely : https://ts-address-type.vercel.app/
- Also we have switched to
moduleResolution: "Bundler"
Thanks Rinat!! Merging this!
Description
Change ts
moduleResolution
toBundler
Context: scaffold-eth#74 (comment)
Also added paths for abitype/viem/wagmi since with
Bundler
abi.d.ts
is ignoredNote: Could you check is everything ok with types? My Vscode getting mad, it can show or not show errors for same code. (as you see build works fine)
Additional Information