Getting this error when building in a dev environment using GatsbyJS:
ERROR
There was an error compiling the html.js component for the development server.
See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html ReferenceError: btoa is not defined
21 | }
22 | else {
> 23 | _btoa = btoa.bind(window);
| ^
24 | helpers = function (url) {
25 | return new URL(url);
26 | };
WebpackError: ReferenceError: btoa is not defined
- helpers.js:23
[eh]/[web3-providers-ws]/lib/helpers.js:23:1
- bootstrap:19
eh/webpack/bootstrap:19:1
- index.js:24
[eh]/[web3-providers-ws]/lib/index.js:24:15
- bootstrap:19
eh/webpack/bootstrap:19:1
- index.js:45
[eh]/[web3-core-requestmanager]/lib/index.js:45:24
- bootstrap:19
eh/webpack/bootstrap:19:1
- index.js:22
[eh]/[web3-core]/lib/index.js:22:24
- bootstrap:19
eh/webpack/bootstrap:19:1
- index.js:29
[eh]/[web3]/lib/index.js:29:12
- bootstrap:19
eh/webpack/bootstrap:19:1
- MoralisWeb3.js:35
[eh]/[moralis]/lib/browser/MoralisWeb3.js:35:35
- bootstrap:19
eh/webpack/bootstrap:19:1
- ParseUser.js:51
[eh]/[moralis]/lib/browser/ParseUser.js:51:42
- bootstrap:19
eh/webpack/bootstrap:19:1
- ParseACL.js:25
[eh]/[moralis]/lib/browser/ParseACL.js:25:41
- bootstrap:19
eh/webpack/bootstrap:19:1
not finished Building development bundle - 6.829s
link to the branch: https://github.com/iammatthias/.com/tree/moralis
related info: https://github.com/ChainSafe/web3.js/issues/1706
This seems to be related to how Moralis is implementing Web3. Any advice would be appreciated!
Note: this is a clean branch. New init of a gatsby site with Moralis and Theme-UI added. All other content and configs have been removed, save for needed polyfills.