I am building a NextJs application using Moralis backend. The functionalities are working well and fine, but on building the code using npm run build command, the build fails with ReferenceError: localStorage is not defined and this is coming from one of the Moralis modules.
I googled a couple of places but couldn’t find a solution.
In one of the previous post on this forum, I found that NextJs support was added for Moralis, but I am unable to build the app. For now I am running “npm run dev” to deploy (dev-build) on prod, but it would be great if someone could point out a solution so that I can build and deploy the production build on the server.
Any help appreciated