web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] Edge Runtime Compatibility Issue: "Class extends value [object Object] is not a constructor or null" with reown app kit

Open TheOska opened this issue 9 months ago • 3 comments

Link to minimal reproducible example

https://github.com/TheOska/edge-runtime-next-wagmi-app-router

Summary

When running my Next.js app with Edge Runtime enabled (i.e., using export const runtime = 'edge'; in my pages), I encounter the following error during runtime:

TypeError: Class extends value [object Object] is not a constructor or null

This error appears to originate from code in the reown app kit package (or one of its adapters). When I disable the Edge runtime (removing export const runtime = 'edge';), the app runs correctly under next.js.

I expect that reown app kit and its adapters work correctly with the Edge runtime. Is this a known issue, or is there a recommended workaround or configuration change to resolve this error when using the Edge runtime?

List of related npm package versions

@reown/appkit: 1.6.9 @reown/appkit-adapter-bitcoin: 1.6.9 @reown/appkit-adapter-solana: 1.6.9 @reown/appkit-adapter-wagmi: 1.6.9 next: ^14.2.7 next-auth: ^4.24.7 next-intl: ^3.4.0 next-themes: ^0.2.1 @cloudflare/next-on-pages: ^1.13.7

Node.js Version

v20.16.0

Package Manager

yarn 1.22.19

TheOska avatar Mar 11 '25 14:03 TheOska

Hi Thanks for raising this we will look into it!

Sam-Newman avatar Mar 13 '25 13:03 Sam-Newman

any update?

pcdotfan avatar May 20 '25 17:05 pcdotfan