The Pros and Cons of React, ViteJS, CRA, and NextJS for Web3 Development

I have been learning Web3 Development and was working on sample projects with React but faced some issues, so I switched to my current favourite framework NextJS and loved it.

Web3

NextJS

Blockchain Development

ReactJS

Ethereum Blockchain

The Pros and Cons of React, ViteJS, CRA, and NextJS for Web3 Development

Last week, while learning Web3, I created a project of React with ViteJS to start a project and started working with Truffle. Everything was going great, I created a smart contract for my project and then when I installed @truffle/contract all the problems started. I have written an article on step-by-step building a Web3 application with NextJS, Solidity and Truffle.

The problem was I started getting errors of some polyfills not present in the environment such as crypto, process etc.

node core module error

Due to all these issues, I wasn’t able to go ahead with the development, then I thought to move it with CRA (Create React App) and as Webpack 5 have removed all the node core modules I got into the same issues as in ViteJS.

I searched for the issue and tried to get help online for adding node core modules polyfills, I found this article which was on point, but still it did not fix my issue.

Frustrated me, decided to go ahead with NextJS as it will have all the core modules and also provides some more functionalities with ease. Like Routing, Layouts also I could create any API in the same codebase if needed. Also, I have already ditched normal react apps with NextJS because of all the additional features.

I copied my smart contracts and installed the package @truffle/contract and ran the application it worked like a charm. I was able to complete the project which was to connect Metamask wallet and can send and receive Ethers from any account from our Smart Contract (Faucet App).

Conclusion

For my other projects, I have stopped using normal ReactJS whether it is with CRA or ViteJS and started using NextJS for React apps but now with this issue, I have completely moved to NextJS because of its versatility. I use TSDX for creating Libraries with Styled Components.


Get latest updates

I post blogs and videos on different topics on software
development. Subscribe newsletter to get notified.


You May Also Like

Express.js Crash Course: Build a RESTful API with Middleware

Express.js Crash Course: Build a RESTful API with Middleware

Learn to build a RESTful API using Express.js, covering middleware, routing, and CRUD operations in just 30 minutes.

Can Next.js Replace Your Backend? Pros, Cons, and Real-World Use Cases

Can Next.js Replace Your Backend? Pros, Cons, and Real-World Use Cases

Explore whether Next.js can fully replace your backend server. Learn about the advantages, limitations, and use cases for using Next.js as a full-stack solution for modern web development projects.

How to Create an Animated Navbar with HTML & CSS (Using Transform & Transitions)

How to Create an Animated Navbar with HTML & CSS (Using Transform & Transitions)

Learn how to create a smooth, responsive animated navbar using HTML and CSS with transitions and transform properties. No JavaScript required!