-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
docs(configuration): fix typo in devServer.onListening
usage
#5310
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
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/Fd3ZW8hDz6wKh8KhqB8iAZ3LnbCP |
onListening: function (server) { | ||
const port = server.address().port; | ||
onListening: function (devServer) { | ||
const port = devServer.server.address().port; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check the existence of devServer
first? https://github.com/webpack/webpack-dev-server/blob/974ce25669ef6a4f55e8a7576fc140bc7ccb55f1/test/server/onListening-option.test.js#L18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, it is unlikely to be undefined
. But no harm in checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @alexander-akait what do you think?
It should be
server.server.address()