question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to run "Getting started" code

See original GitHub issue

Describe the bug Cannot run React example from docs. If the app is using TypeScript it even crashes.

SDK Version

  • Version 2.0.0-alpha.7

To Reproduce Steps to reproduce the behavior: Just followed “Getting Started” here:

  1. npm install @web3modal/react @web3modal/ethereum ethers
  2. set this code
import { ConnectButton, Web3Modal } from '@web3modal/react'

const config = {
  projectId: '<YOUR_PROJECT_ID>', // Here I added the projectId I got on cloud.walletconnect.com
  theme: 'dark',
  accentColor: 'default',
  ethereum: {
    appName: 'myApp' // Here added the project name I created on cloud.walletconnect.com
  }
}

export default function App() {
  return (
    <>
      <ConnectButton />
      <Web3Modal config={config} />
    </>
  )
}

Question 1: I am running it locally, I could not add “localhost” on my cloud.walletconnect.com project allowed domains. Is it relevant? Question 2: should the appName in the config match the project name on cloud.walletconnect.com project? Question 3: Am I missing something?

Expected behavior Simply connect, I expect as a developer that it is easy to connect and the documentation is understandable or that I get some clear error message.

Screenshots Also I got this message from MetaMask: Connection Declined.

Screenshot 2022-10-23 at 18 53 05

Desktop (please complete the following information):

  • OS: iOS
  • Browser Chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: iPhone13 mini
  • OS: [e.g. iOS8.1]
  • Browser Safari
  • Version [e.g. 22]

Additional context On a React app using only JS, I was not able to connect Metamask. I tried on mobile also with TrustWallet, got no result. Tried also on React app based on TS.

By the way I am getting also this warning

WARNING in ./node_modules/json-rpc-engine/dist/mergeMiddleware.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/io/Code/my-app/node_modules/json-rpc-engine/src/mergeMiddleware.ts' file: Error: ENOENT: no such file or directory, open '/Users/io/Code/my-app/node_modules/json-rpc-engine/src/mergeMiddleware.ts'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
0xAsimetriqcommented, Oct 25, 2022

100%

basic connect snippet (needs to handle the ConnectButton to return null once account.isConnected) otherwise many other devs will get frustrated at first try.

This will be handled in next release (i.e. introduction of automatic Disconnect button), so should help others who don’t use custom buttons

HTTPS is mandatory if you run it on iPhone.

Gonna add this in as well 👍

1reaction
qeternitycommented, Oct 24, 2022

yes, fresh repo image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix This Device Cannot Start.(Code 10)?
Part 2: How to Fix This Device Cannot Start (code 10)? · Method 1: Use Another USB Port/Hub · Method 2: Check the...
Read more >
13 Methods to Fix This Device Cannot Start (code 10) Error
Part 1: How to Fix This Device Cannot Start (code 10)? · Method 1. Reboot Your Computer · Method 2. Run the Hardware...
Read more >
"Error while trying to run project: Unable to start program". Can ...
12 Answers 12 · First restart Visual Studio · Click the build icon · Select the rebuild option · Run the Program or...
Read more >
VS IDE 2019 How to fix "Unable to start program...
Recently installed Visual Studio IDE 2019 version 16.10.0. I get no errors when BUILDING SOLUTION from the main.cpp file. But, when I run...
Read more >
Error while trying to run project: Unable to start program 'C ...
"Error while trying to run project: Unable to start program 'C:\Visual Studio 2017 Projects\ConsoleApp3\ConsoleApp3.exe'. The debugger is not properly installed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found