Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2로 reload될 때 유연하게 종료되지 않는 에러 해결 #13

Closed
hyejungg opened this issue Mar 30, 2022 · 0 comments · Fixed by #14
Closed

pm2로 reload될 때 유연하게 종료되지 않는 에러 해결 #13

hyejungg opened this issue Mar 30, 2022 · 0 comments · Fixed by #14
Assignees
Labels
bug bug 및 hotfix 수정

Comments

@hyejungg
Copy link
Member

What happened? 🤷‍♀️

빌드 파일이 reload될 때 우아하게? 종료되지 않는 에러 발생

아래 로그는 api server에 해당하지만 push server도 동일

0|api-serv | TypeError: Assignment to constant variable.
0|api-serv |     at process.eval (webpack://server/./src/app.js?:52:22)
0|api-serv |     at process.emit (node:events:520:28)
0|api-serv | TypeError: app.close is not a function
0|api-serv |     at process.eval (webpack://server/./src/app.js?:44:7)
0|api-serv |     at process.emit (node:events:520:28)

How to encounter bug 🐛

app.listen()은 http.Server를 return한다.
따라서 close()를 하려면 app에 하는 것이 아니라 http.server 자체에 해야하기 때문에 아래와 같이 수행한다.

let server = app.listen(port)
server.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug 및 hotfix 수정
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant