[SOLVED] Axios Error while using Moralis Auth

Iā€™m running the code from this tutorial with the correct API token and env variables but get the following error when clicking on the ā€œAuthenticateā€ button

Unhandled Runtime Error

AxiosError: Internal Server Error

##### Call Stack

###### settle

node_modules/axios/dist/browser/axios.cjs (1899:0)

###### XMLHttpRequest.onloadend

node_modules/axios/dist/browser/axios.cjs (2208:0)

Console gives the following error:

Moralis[nextjs]: Unknown error in MoralisNextApi: Operation requestChallengeEvm has no group name in auth {
  error: Error: Operation requestChallengeEvm has no group name in auth
      at Module.getRequestHandler (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/Modules.js:26:19)
      at /Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:74:47
      at step (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:33:23)
      at Object.next (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:14:53)
      at /Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:4:12)
      at MoralisNextHandler (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:62:12)
      at /Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:113:31
      at step (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:33:23)
      at Object.next (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:14:53)
      at /Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (/Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:4:12)
      at /Users/sg/Apps/stepa_eth/node_modules/@moralisweb3/next/lib/MoralisNextApi/MoralisNextApi.js:112:41
      at Object.apiResolver (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/api-utils/node.js:372:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DevServer.runApi (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/next-server.js:488:9)
      at async Object.fn (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/next-server.js:751:37)
      at async Router.execute (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/router.js:253:36)
      at async DevServer.run (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/base-server.js:384:29)
      at async DevServer.run (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/dev/next-dev-server.js:741:20)
      at async DevServer.handleRequest (/Users/sg/Apps/stepa_eth/node_modules/next/dist/server/base-server.js:322:20)

The solution should be in a similar thread on this forum. I think that you have to change a line of code.

1 Like
1 Like

Thank you! Didnā€™t notice this on the forum.

Works for me.

2 Likes