Skip to content

Nuxt restart hook stop working in 3.7.0 #135

@TechAkayy

Description

@TechAkayy

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, open my-config.ts in both repos, save the file. nuxt-365 restarts nuxt, but nuxt-370 doesn't.

Describe the bug

I'm a module author, and I watch a config file (my-config.ts in the reproduction) and when it's updated, I hard restart nuxt.

The above reproduction is minimal and only difference is the nuxt version used (3.6.5 vs 3.7.0)

Nuxt restart hook use to work in 3.6.5, but doesn't in 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.callHook('restart', {hard: true})

Additional context

Thanks for looking into this. If you require any more info, please let m eknow.

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions