wevm / wagmi

Reactive primitives for Ethereum apps
https://wagmi.sh
MIT License
5.9k stars 1.02k forks source link

bug: Module not found: Can't resolve 'encoding' in '/repo/node_modules/node-fetch/lib' #1432

Closed montanaflynn closed 1 year ago

montanaflynn commented 1 year ago

Is there an existing issue for this?

Package Version

0.8.6

Current Behavior

When I use the next13 development server I get a lot of these warnings:

npm run dev
....
warn  - ./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '/repro/node_modules/node-fetch/lib'

I can see that node-fetch is a dependency of wagmi (or rather from it's dependencies):

npm ls node-fetch
example@0.1.0 /repro
└─┬ wagmi@0.8.6
  ├─┬ @coinbase/wallet-sdk@3.6.0
  │ ├─┬ @solana/web3.js@1.52.0
  │ │ ├── node-fetch@2.6.7
  │ │ └─┬ react-native-url-polyfill@1.3.0
  │ │   └─┬ react-native@0.70.6
  │ │     ├─┬ @react-native-community/cli-platform-android@9.3.1
  │ │     │ └─┬ @react-native-community/cli-tools@9.2.1
  │ │     │   └── node-fetch@2.6.7 deduped
  │ │     └─┬ @react-native-community/cli@9.3.2
  │ │       └─┬ @react-native-community/cli-plugin-metro@9.2.1
  │ │         └─┬ metro@0.72.3
  │ │           └── node-fetch@2.6.7 deduped
  │ └─┬ eth-json-rpc-filters@4.2.2
  │   └─┬ eth-json-rpc-middleware@6.0.0
  │     └── node-fetch@2.6.7 deduped
  └─┬ @walletconnect/ethereum-provider@1.8.0
    └─┬ @walletconnect/jsonrpc-http-connection@1.0.4
      └─┬ cross-fetch@3.1.5
        └── node-fetch@2.6.7 deduped

Expected Behavior

No warnings

Steps To Reproduce

Make a next13 app and use wagmi

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

montanaflynn commented 1 year ago

I was able to stop the warnings by installing encoding separately after I found an issue saying it was an "optional" dependency of node-fetch, whatever that means.

npm install encoding
tmm commented 1 year ago

Thanks for reporting. This issue is temporarily closed due to lack of information. Please provide a minimal reproducible example and reopen this issue.

github-actions[bot] commented 7 months ago

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 other comments you can create a new discussion.