Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebSockets request was expected error when using --inspect-brk option

When I run nodemon dist/server/app.js it works on default port 3000 and I'm able to reach my API. But if I run

nodemon --inspect-brk=localhost:3000 dist/server/app.js

I got error

WebSockets request was expected

What's wrong?

like image 911
ycshao Avatar asked Apr 11 '18 04:04

ycshao


1 Answers

You can't run your web server and the debugger on the same port. They are each separate servers (the debugger is a server built into the node.js runtime).

So, you can either remove the port and host designation from the --inspect-brk option and just let it use the defaults (which is all I ever use) or you can select a different port for the debugger that doesn't conflict with your web server or anything else running on that host.

like image 111
jfriend00 Avatar answered Oct 01 '22 06:10

jfriend00