Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuxt run dev fatal error with status code 500

I was working on a Nuxt.js project and everything was working perfectly, then suddenly the npm run dev failed. I tried to run it again and I am constantly getting this error:

 FATAL  Request failed with status code 500                                                                                          17:43:55

  at createError (node_modules/axios/lib/core/createError.js:16:15)
  at settle (node_modules/axios/lib/core/settle.js:18:12)
  at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:201:11)
  at IncomingMessage.emit (events.js:194:15)
  at IncomingMessage.EventEmitter.emit (domain.js:441:20)
  at endReadableNT (_stream_readable.js:1125:12)
  at process._tickCallback (internal/process/next_tick.js:63:19)


   ╭────────────────────────────────────────────────╮
   │                                                │
   │   ✖ Nuxt Fatal Error                           │
   │                                                │
   │   Error: Request failed with status code 500   │
   │                                                │
   ╰────────────────────────────────────────────────╯

npm ERR! code ELIFECYCLE
npm ERR! errno 1

I tried some typical solutions like removing the node_modules and .nuxt directories and installing the dependencies again, and went even further and re-installed nodejs but non of them worked. It is really strange since it happened suddenly while I wasn't actually changing anything on the code, however I even recovered the latest working version of the app just to be sure, but that didn't help either. Whatever is it, is not related to the project codes since the same code was working before without any error.

like image 824
Torgheh Avatar asked Oct 29 '25 14:10

Torgheh


1 Answers

I found the solution myself and I share it so no one else has to spend half a day figuring what is wrong.

Solution

A failed axios request inside the nuxt.config.js has caused this problem. So find the reason why the axios request throws the error, which is most probably because of a change in the api you are trying to call.

like image 190
Torgheh Avatar answered Oct 31 '25 05:10

Torgheh