Environment
- Operating System:
Darwin
- Node Version:
v18.12.1
- Nuxt Version:
3.7.0
- CLI Version:
3.7.3
- Nitro Version:
2.6.2
- Package Manager:
npm@8.19.2
- Builder:
-
- User Config:
modules, devtools
- Runtime Modules:
()
- Build Modules:
-
Reproduction
Worked before in 3.6.5 - https://github.com/TechAkayy/nuxt-365
Stopped working in 3.7.0 - https://github.com/TechAkayy/nuxt-370
Clone & install deps in both repo. Start dev-server. Check console in the editor - nuxt-365 logsDevserver running at: 3000, but nuxt-370 logs Devserver running at: 60225 (port numbers might be different)
Describe the bug
I'm a module author, and I use the nuxt listen hook to know which port is the devserver running.
The above reproduction is minimal and only difference is the nuxt version used (3.6.5 vs 3.7.0)
Nuxt listen hook returned correct port number in 3.6.5, but doesn't from 3.7.0 - https://nuxt.com/docs/api/advanced/hooks#nuxt-hooks-build-time
Please refer to the inline module in nuxt.config.ts, and this is the way I use the hook:
nuxt.hook('listen', async (listenerServer) => {
// @ts-ignore
const port = listenerServer.address().port
console.log(`Devserver running at: ${port}`)
})
Additional context
Thanks for looking into this. If you require any more info, please let m eknow.
Logs
No response
Environment
Darwinv18.12.13.7.03.7.32.6.2npm@8.19.2-modules,devtools()-Reproduction
Worked before in 3.6.5 - https://github.com/TechAkayy/nuxt-365
Stopped working in 3.7.0 - https://github.com/TechAkayy/nuxt-370
Clone & install deps in both repo. Start dev-server. Check console in the editor -
nuxt-365logsDevserver running at: 3000, butnuxt-370logsDevserver running at: 60225(port numbers might be different)Describe the bug
I'm a module author, and I use the nuxt listen hook to know which port is the devserver running.
The above reproduction is minimal and only difference is the nuxt version used (3.6.5 vs 3.7.0)
Nuxt
listenhook returned correct port number in 3.6.5, but doesn't from 3.7.0 - https://nuxt.com/docs/api/advanced/hooks#nuxt-hooks-build-timePlease refer to the inline module in
nuxt.config.ts, and this is the way I use the hook:Additional context
Thanks for looking into this. If you require any more info, please let m eknow.
Logs
No response