When I include the web3 js CDN to my html file, I receive this error

web3.min.js:1 Uncaught ReferenceError: regeneratorRuntime is not defined at Object.<anonymous> (web3.min.js:1)

Here is the CDN I am using


How do I use this CDN correctly?


I think your cdn has outdated, i have read the code inside that cdn. It try to call regeneratorRuntime object but they haven’t define that object yet.

You should use the new one instead on this site: https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.34/dist/ (they have fix it)


See https://github.com/ethereum/web3.js/issues/3058 and https://github.com/ethereum/web3.js/issues/3155

A workaround is to include polyfill.min.js:

<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script> 

The latest version on cdn is currently:

Version 1.2.2 is also available via:

npm install web3

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.