reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.89k stars 1.37k forks source link

[bug] Appkit not working with Nextjs anymore - { pino } import error #2980

Open AnesBkdm opened 2 days ago

AnesBkdm commented 2 days ago

Link to minimal reproducible example

https://github.com/AnesBkdm/appkit-not-working

Summary

AppKit worked on our Nextjs project (we don't use App Router) just fine until yesterday. Nextjs now throws an import error even on fresh project installs. Reproduce via attached repo: https://github.com/AnesBkdm/appkit-not-working

SyntaxError: Named export 'pino' not found. The requested module '@walletconnect/logger' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@walletconnect/logger';
const { pino } = pkg;
Screenshot 2024-10-02 at 09 07 37

The error suggests editing node_module files, which obviously is not ideal. Has anyone come across this issue?

List of related npm package versions

"dependencies": {
    "@reown/appkit": "^1.0.5",
    "@reown/appkit-adapter-wagmi": "^1.0.5",
    "@tanstack/react-query": "^5.56.2",
    "next": "14.1.0",
    "react": "^18",
    "react-dom": "^18",
    "viem": "^2.21.16",
    "wagmi": "^2.12.16"
  },
AnesBkdm commented 2 days ago

I would like to add that this error is common on wagmi, ethers6 and ethers5 modes of Reown Appkit. We had to fallback to the old Web3Modal packages suggested in the dashboard to keep our web3 Login feature.

Screenshot 2024-10-02 at 09 26 16
dms120 commented 1 day ago

I'm also struggling with this one. It was introduced here.