WalletConnect / walletconnect-monorepo

WalletConnect Monorepo
Apache License 2.0
1.47k stars 715 forks source link

WalletConnect v2 does not work with SvelteKit+Vite (rollup) #864

Closed tfalencar closed 1 year ago

tfalencar commented 2 years ago

When trying to follow the tutorial on:

https://docs.walletconnect.com/2.0/quick-start/dapps/ethereum-provider

The following error appears:

500 Importing binding name 'PairingTypes' is not found. moduleDeclarationInstantiation@[native code] link@[native code] linkAndEvaluateModule@[native code] @[native code] asyncFunctionResume@[native code] @[native code] promiseReactionJobWithoutPromise@[native code] promiseReactionJob@[native code]

Steps to reproduce:

zhanzekun commented 2 years ago

+1

yekta commented 2 years ago

I'm having the same problem. Are there any good workarounds?

avivash commented 2 years ago

@tfalencar as a temporary workaround, I was able to get it all running in sveltekit using these imports. Vite borks unless you import the umd files directly for some reason and the types should work if you add import type to the beginning to denote that it's a typescript import

import WalletConnectProvider from '@walletconnect/ethereum-provider/dist/umd/index.min'
import WalletConnectClient, { CLIENT_EVENTS } from '@walletconnect/client/dist/umd/index.min'
import type { PairingTypes, SessionTypes } from '@walletconnect/types'
finessevanes commented 1 year ago

@tfalencar @yekta is this still an issue?

tfalencar commented 1 year ago

@finessevanes I think its better to ask the walletconnect's development team if they solved the root cause of this issue.

glitch-txs commented 1 year ago

I’m closing this issue because it has been inactive for a few months.

Please reopen if you still encounter this issue with the latest version :)

glitch-txs commented 11 months ago

SvelteKit + Web3Modal example: https://github.com/WalletConnect/web-examples/pull/346