You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportdefaultdefineNuxtPlugin({name: 'my-plugin',enforce: 'pre',// or 'post'asyncsetup(nuxtApp){// this is the equivalent of a normal functional plugin},hooks: {// You can directly register Nuxt app hooks here'app:created'(){constnuxtApp=useNuxtApp()// }}})
Describe the bug
Hooks in plugins are not firing when defined via object syntax. Minimal example exactly like in documentation is not working. Defining a hook in the setup function of the plugin works.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Aietes
changed the title
Hook defined via Plugin Object Syntax are not working
Hooks defined via Plugin Object Syntax are not working
Jul 19, 2023
I created a clean Nuxt project locally, with no plugins or additional dependencies. As described above, the setup function fires, but the hooks don't. I'm not sure why this is not reproducible on stackblitz, or where this is coming from :(
Environment
Reproduction
Describe the bug
Hooks in plugins are not firing when defined via object syntax. Minimal example exactly like in documentation is not working. Defining a hook in the setup function of the plugin works.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: