ethereum / remix-desktop

Remix IDE desktop
1.03k stars 265 forks source link

Can't connect remix IDE to localhost hardhat chain #90

Open LucianoTrujillo opened 2 years ago

LucianoTrujillo commented 2 years ago

I've followed both https://remix-ide.readthedocs.io/en/latest/remixd.html and https://remix-ide.readthedocs.io/en/latest/hardhat.html step by step, but when trying to choose hardhat environment, this error appears:

"Not possible to connect to the Web3 provider. Make sure the provider is running, a connection is open (via IPC or RPC) or that the provider plugin is properly configured."

but, I can deploy locally using hardhat, so blockchain is running and listening. Also, I have default configuration.

MacOS, latest Chrome

yann300 commented 2 years ago

do you have the hardhat network running on your system? (port 8545)

LucianoTrujillo commented 2 years ago

yes, 127.0.0.1:8545

DavisChang commented 2 years ago

Access to fetch at 'http://127.0.0.1:8545/' from origin 'https://remix.ethereum.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Private-Network' header was present in the preflight response for this private network request targeting the local address space.

I think this issue is regarding to CORS

azhar0406 commented 1 year ago

The issue turned out to be caused by the browser I was using: Brave. It has some default ad blockers called "shields". These somehow prevented me from connecting the Metamask extension to my local network. In Brave settings for shields, I set "Trackers & ads blocking" to "disabled", and the issue was resolved.

source: https://ethereum.stackexchange.com/questions/94231/how-can-i-connect-a-local-hardhat-network-to-metamask

bharathmb7 commented 1 year ago

Facing the same issue, tried changing the browser but not helping. Also disabling shields on Brave is also not helping

0xivanov commented 1 year ago

If you are using chrome, refer to this thread: https://stackoverflow.com/questions/66534759/cors-error-on-request-to-localhost-dev-server-from-remote-site

Kourin1996 commented 1 year ago

In my case, I needed to specify CORS domain like package://.....mod even thought I used Desktop version and the node was running in same computer. You may be able to see CORS error in Chrome Dev Tools, which you can open from Toggle Developer Tools in Help menu