web3-react icon indicating copy to clipboard operation
web3-react copied to clipboard

Argument of type '{ rpc: { 1: string; 3: string; 4: string; }; bridge: string; qrcode: true; pollingInterval: number; }' is not assignable to parameter of type 'WalletConnectConnectorArguments'.

Open dynamasoft opened this issue 4 years ago • 3 comments

Bug Description

I have a website built using react and craco. Here is the script in the package.json.

"scripts": { "start": "craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject", "lint": "eslint --ext js,ts,tsx src --max-warnings=0", "lint:fix": "yarn lint --fix", "typescript:check": "tsc --noEmit --composite false", "check:all": "yarn lint && yarn typescript:check", "prettify": "prettier --single-quote --trailing-comma es5 --write src/**/*.{js,ts,tsx}" },

When I ran "yarn run build" I kept getting this error

TypeScript error in C:/Projects/Netvrk/dashboard-frontend/src/utils/web3React.ts(17,3): Argument of type '{ rpc: { 1: string; 3: string; 4: string; }; bridge: string; qrcode: true; pollingInterval: number; }' is not assignable to parameter of type 'WalletConnectConnectorArguments'. Object literal may only specify known properties, and 'pollingInterval' does not exist in type 'WalletConnectConnectorArguments'. TS2345

It was occuring on this line before.

export const walletconnect = new WalletConnectConnector({ rpc: RPC, bridge: 'https://bridge.walletconnect.org', qrcode: true, pollingInterval: POLLING_INTERVAL, <------------- Pooling interval does not exist. });

Please help. I am using windows 11, vscode, react and craco framework.

dynamasoft avatar Jan 03 '22 19:01 dynamasoft

Not sure which version of @web3-react/walletconnect-connector you are using, but we were able to fix this issue by downgrading to 6.2.4 from 6.2.8

devinMcArthur avatar Jan 07 '22 20:01 devinMcArthur

hi! library author here, sorry for the (extremely) slow responses; for an update on the state of this library, please see https://github.com/NoahZinsmeister/web3-react/issues/163#issuecomment-1010210571

TLDR: v6 is deprecated and going into maintenance mode. i expect not to make any non-security related changes going forward (however, you're always welcome to! the beauty of open source)

i'll be closing a lot of issues with this message right now, but please feel free to re-open if you think the topic is still relevant!

thanks for using web3-react <3

NoahZinsmeister avatar Jan 11 '22 21:01 NoahZinsmeister

Hi everyone - if anyone is still struggling with this, I randomly changed 'rpcUrl' to 'rpc' in the WalletConnectConnector constructor during its instantiation and that solved this problem for me without downgrading.

const WalletConnect = new WalletConnectConnector({
  rpc: `https://mainnet.infura.io/v3/${INFURA_ID}`, // <-- here
  bridge: "https://bridge.walletconnect.org",
  qrcode: true,
});

ogg130 avatar Aug 15 '22 03:08 ogg130