Skip to content

[bug] Unhandled Promise Rejection on getSupportedNetworks #3896

Closed
@xyzseer

Description

@xyzseer

Link to minimal reproducible example

N / A

Summary

Hi, we have a vite app with SSR enabled, and we are seeing this error on the logs

Feb 21, 07:11:58 AM: 721e05e3 ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: fetch failed","reason":{"errorType":"TypeError","errorMessage":"fetch failed","stack":["TypeError: fetch failed"," at node:internal/deps/undici/undici:13185:13"," at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"," at async fetchData (file:///var/task/node_modules/@reown/appkit-core/dist/esm/src/utils/FetchUtil.js:2:22)"," at async Proxy.get (file:///var/task/node_modules/@reown/appkit-core/dist/esm/src/utils/FetchUtil.js:20:26)"," at async Object.getSupportedNetworks (file:///var/task/node_modules/@reown/appkit-core/dist/esm/src/controllers/BlockchainApiController.js:110:33)"," at async AppKit.initializeBlockchainApiController (file:///var/task/web/node_modules/@reown/appkit/dist/esm/src/client.js:507:9)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: fetch failed"," at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)"," at process.emit (node:events:519:28)"," at emitUnhandledRejection (node:internal/process/promises:250:13)"," at throwUnhandledRejectionsMode (node:internal/process/promises:385:19)"," at processPromiseRejections (node:internal/process/promises:470:17)"," at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}

I think the request made by getSupportedNetworks fails and as it happens on the server it completely kills the webpage

Is there any way to fix it? I saw a PR that deferred the call (#3810), maybe something like that should work?

Thanks!

List of related npm package versions

"@reown/appkit": "^1.6.8",
"@reown/appkit-adapter-wagmi": "^1.6.8",
"viem": "2.17.5",
"vike": "^0.4.223",
"wagmi": "2.14.6",

Node.js Version

20.18.0

Package Manager

yarn

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions