[SOLVED] Moralis Auth Not Working on Production

Hi we are getting ready to deploy our dApp with Moralis. Our app is using the following main stacks:

"react": "^17.0.2",
"react-moralis": "^0.2.0",
"moralis": "^0.0.35",
"next": "^11.1.0",

It is a React/Next.js app and everything works as expected in development (localhost) but in production getting 308 response initially then a 404… not sure what the issue is here… Maybe we need to implement it differently because its’ a React/Next.js project? The wallet extension pops up open but when you click sign the error is thrown in production.

We wrapped the react-moralis in our _app.js file and can use it in all of our components… and we call the authenticate method in the React components and it works fine in development… would be awesome if we can get some help or get some insight so we can troubleshoot… wish I can provide more detailed info, but the dApp is under NDA so can’t really expose too much info except the behavior we are facing. But happy to connect and show you if that’s better.

Thanks to all the Mages in the community and looking forward to connecting with another amazing mage soon so we can make this world a better place with our dApps!


Hi, thanks for writing - very difficult to say anything without seeing the full errors - screenshot the console

can I DM you on discord? I’ll provide it for you there

No please post here so we can get others to help, im here mainly to collect info

I noticed a relatively old version of Moralis SDK, latest should be 0.0.44

1 Like

ok thanks i’ll try that

Okay after long nights of crying our DevOps guy finally figured it out. The moralis server address that was saved in the .env file had quotations around it… it prepends the baseURL when it had the quotations during our deployment build. If someone ever comes across this problem hopefully it helps!