DEV Community

aidoit
aidoit

Posted on

Please help me, I can't figure out what is causing this 500 (Internal Server Error)

System infomation

  • Fedora38 Workstation
  • Node.js 16.15
  • Next.js 12.1
  • Chrome 113
  • Vscode 1.78.2 Electron for linux

Image description

Image description

Image description

The information in the terminal makes it impossible for me to judge the specific cause of this 500 error, I checked a lot on google and stackoverflow, but found nothing. I even asked chatGPT and it's driving me crazy, please help me, thanks!

Top comments (3)

Collapse
 
tr11 profile image
Tiago Rangel

Hi! It would be easier to debug if you provide your server's code, as the 500 error can be caused by multiple issues.

Collapse
 
aidoit profile image
aidoit • Edited

Thanks! You mean the code of dev-server.js?

const { config } = require('@wipi/config');
const cli = require('next/dist/cli/next-dev');

const port = config.CLIENT_PORT || 3001;

try {
  cli.nextDev(['-p', port]);
  console.log(`[wipi] client started,port:${port}`);
} catch (err) {
  console.log(`[wipi] Client failed to start! ${err.message || err}`);
}
Enter fullscreen mode Exit fullscreen mode

Complete open source project:
github.com/fantasticit/wipi

To clarify: I debugged this blog on my laptop about a year ago and it worked, and it was great! After several updates of my fedora system, I'm confused by this strange error.

Collapse
 
aidoit profile image
aidoit • Edited

I'd say I made a really stupid mistake:
I mentioned the fedora system update above. Fedora may automatically install the latest version of node.js when it is updated, but the way I use node.js is to install it manually: download it to the home directory, and then modify the environment variables. (use the latest version with caution)
Just like this, there are two versions of node.js in my system at the same time, and the strange error I mentioned above appeared.

Thks,@tiagorangeldesousa,thanks for your answer, and thanks for taking the time to look at my stupid question.