Importing web3@1.0.0-beta.55 in a stencil+typescript file for a frontend application directly triggers an error, even without using the imported Web3 object whatsoever.

import Web3 from 'web3';


TypeError: Cannot read property 'WebSocket' of undefined

This seems expected as Stencil don't use Webpack. Which is the best way to use Web3 1.0 in the browser? Is there a browser-compatible version of it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.