web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] Appkit: failed to compile metamask-sdk.js in nextjs with turbo mode

Open agualis opened this issue 7 months ago • 5 comments

Link to minimal reproducible example

https://github.com/agualis/next-wagmi-app-router

Summary

Instructions to reproduce:

pnpm install
pnpm run dev --turbo 

Opening app in localhost:3000 will crash with:

Build Error
Failed to compile

./node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@metamask/sdk/dist/browser/es/metamask-sdk.js:1:419267

Expected behaviour:

App should should work as when running it in webpack mode (pnpm run dev).

Extra:

It looks related with this fixed issue.

Note that the provided reproduction repo was copied from reown appkit examples directory so you could also reproduce it there.

List of related npm package versions

"@reown/appkit": "1.7.4", "@reown/appkit-adapter-wagmi": "1.7.4", "viem": "2.23.13", "wagmi": "2.14.16", "next": "14.2.28"

Node.js Version

v20.10.0

Package Manager

[email protected]

agualis avatar May 06 '25 11:05 agualis

@agualis thanks for reporting! are you temporarily unblocked by dropping --turbo and running pnpm run dev?

Note that the provided reproduction repo was copied from reown appkit examples directory so you could also reproduce it there.

We're currently migrating to Next 15.3 so may encounter as part of that

arein avatar May 08 '25 18:05 arein

@agualis thanks for reporting! are you temporarily unblocked by dropping --turbo and running pnpm run dev?

That works but it's not an option as webpack speed makes DX too painful.

We're currently migrating to Next 15.3 so may encounter as part of that

We are also about to migrate to Next 15.x but it would be desirable to make it work with any Next version.

Thanks for the update.

agualis avatar May 09 '25 07:05 agualis

Hey @agualis Are you ok with this for now?

Sam-Newman avatar May 15 '25 10:05 Sam-Newman

Hey, we are not. See my previous comment: this issue implies using webpack for development which is not an option for us.

agualis avatar May 15 '25 11:05 agualis