trufflesuite / drizzle

Reactive Ethereum dapp UI suite
905 stars 235 forks source link

Drizzle has problem connecting to Infura because of Web3 v1.0.0-beta35 #42

Closed Muhammad-Altabba closed 4 years ago

Muhammad-Altabba commented 5 years ago

There is a issue with Web3 v1.0.0-beta35 that Drizzle depend on.

Error:

WebSocket connection to 'wss://mainnet.infura.io/ws' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

Web3 has to be downgraded to v1.0.0-beta33 or upgreaded to version v1.0.0-beta36 and above.

simondlr commented 5 years ago

What's the most efficient way to downgrade web3 to work with websockets? Experiencing same issue. Tried forking drizzle from develop and editing package.json, but screws up dependencies for drizzle-react. So, wondering about my options atm.

EDIT:

Managed to fix it here [based of 1.3.3]: https://github.com/simondlr/drizzle/tree/web3mod

simondlr commented 5 years ago

fwiw. This is still an issue for me. I can't use Drizzle's fallback to websockets with beta35 [which it is currently at].

adrianmcli commented 5 years ago

@simondlr Which version of Web3 should we be on? As far as I know (and I don't know much), there is still some discussion about what beta version we need to rely on since there are breaking changes between some of them.

simondlr commented 5 years ago

@adrianmcli all I know is currently that beta33 works fine for me. Perhaps future version fixed things?

adrianmcli commented 5 years ago

I think beta53 is coming out soon with a bunch of changes that un-breaks things with Truffle (according to this comment), we can try using that when it is released.

n1c01a5 commented 5 years ago

I tried with the 53 version but I still have this problem to use the web3 fallback. I have this error:

Error in block processing:
TypeError: Cannot read property 'transactions' of null
adrianmcli commented 5 years ago

Thanks for the data point @n1c01a5, we'll look into this.

n1c01a5 commented 5 years ago

@adrianmcli do you have any updates about the fallback?

It seems working with "drizzle": "simondlr/drizzle#web3mod", this version use the beta33 of web3 (but it's "ugly" to use this trick. I'm waiting for a better solution).

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if there is no reply to further comments.

apbendi commented 5 years ago

As far as I can tell, this is still a problem with the latest version of Drizzle. I've yet to find around a workaround, and am currently in npm hell trying to get a version of Drizzle with an upgraded or downgraded web3. Any suggestions?

apbendi commented 5 years ago

I tried to fork Drizzle and downgrade the dependency, then use my GitHub version as the dependency: https://github.com/apbendi/drizzle/tree/web3fix

However, that results in the following build error from npm start:

./node_modules/drizzle-react/dist/drizzle-react.js
Module not found: Can't resolve 'drizzle' in '/Users/ben/Development/forehash/app/node_modules/drizzle-react/dist'
JasoonS commented 4 years ago

This is working for me right now with the latest version of drizzle (the one at @drizzle/store).

There were some strange things happening in my code when I didn't explicitly specify the fixed version of 1.2.1 of web3 in my package.json though (drizzle specifies ^1.2.1). I don't think this is due to drizzle though, and rather I think there is some kind of interference with the versioning from some of the other dependencies I have (I am integrating walletconnect, portis, torus, fortmatic and squarelink). If this is a concern for you I'll dig up more details, let me know.

So from my side I think this issue can be closed, and I no longer have to maintain a fork with a different web3 version :) (before I in my fork I was using web3 1.2.0)

jamesmorgan commented 4 years ago

I have this issue in vue-drizzle - failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

tung-eh commented 4 years ago

@JasoonS This change haven't released yet, you can look at the code on master branch to see the published code.

I also wonder when you guys will release it.

adrianmcli commented 4 years ago

@tung-eh Good catch.

@cds-amal We need to make a release this week just based off of what we have right now.

cds-amal commented 4 years ago

@tung-eh can you verify if the release solved your issue?

friedhelmensch commented 4 years ago

I had the same issue:

WebSocket connection to 'wss://mainnet.infura.io/ws' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

and can confirm that it is solved with the latest release.

as a remark: https://github.com/trufflesuite/drizzle/issues/42#issuecomment-489356887

Error in block processing: TypeError: Cannot read property 'transactions' of null

I am seeing the same problem but this is probably a different issue.

adrianmcli commented 4 years ago

can confirm that it is solved with the latest release

Thanks let's close this for now. Regarding the other issue, we'd appreciate opening a new one :)