react-moralis doesn't support create-react-app

Create-react-app (react-script) is almost an industry standard for React web apps, and it depends on webpack 5.
If you don’t intend to support it as soon as possible, let us know immediately.
We chose Moralis precisely to avoid such things. The fact that you mentioned the problem and do not intend to solve it is much worse than not knowing about the problem at all.
What is the point in supporting the last react if you do not support create-react-app?

Hey for now add this to your react webpack.config.js file
``
module.exports = {
resolve: {
fallback: {
assert: require.resolve(‘assert’),
crypto: require.resolve(‘crypto-browserify’),
http: require.resolve(‘stream-http’),
https: require.resolve(‘https-browserify’),
os: require.resolve(‘os-browserify/browser’),
stream: require.resolve(‘stream-browserify’),
},
},
};

Thanks but no thanks.
I know for workaround already, but I don’t want to use a workaround for something that should be straightforward. I don’t want to expose webpack config in my project folder. That’s the point of using create-react-app.
I would rather leave Moralis for now.
But don’t you think that community has the right to know that you won’t support create-react-app in closer future?
It is very important information.

the code is open source, you can also contribute if you know exactly what has to be changed: https://github.com/MoralisWeb3/react-moralis

1 Like

Moralis just released the newest version of their Javascript SDK which is now based on ethers.js instead of web3.js and works just fine with create-react-app 5.
Ether.js doesn’t require polyfills, which is why the previous version didn’t work as it was based on web3 which needs polyfils to run the node module dependencies in the browser and webpack 5 dropped the default support for that.

As you mentioned there is a work around. Bur for anyone else who might bump into this, If you still need web3 or use a web3 provider you can use react-app-rewired and override the webpack config like this to add in the needed polyfills

or import the compiled library from th cdn directly in index.html as explain in the github repo.

2 Likes