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

。_饼干妹妹 提交于 2020-12-04 21:43:05

问题


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 saying "WebSockets request was expected". What's wrong?


回答1:


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.



来源:https://stackoverflow.com/questions/49766500/websockets-request-was-expected-error-when-using-inspect-brk-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!