Running 'app:created' nuxt hook before middleware #27023
Unanswered
hipkiss1991
asked this question in
Questions
Replies: 1 comment
-
|
just remove the nuxtApp.hook('app:created', async() => { ... }) and immediatly call inside the plugin |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Versions:
Situation:
The project I'm working on is using
nuxtApp.hook('app:created'in a plugin to setup / initialise the pinia stores / initial data. This includes pinia store setup and a couple of API calls for user data.When doing so, I am seeing that the middleware
alwaysruns before this lifecycle hook.This is not a global middleware.
Question
How do I get the middleware to run
afterthe plugin hook has finished.Tried
nuxtApp.$piniapass through to try and force the correct pinia store state.01.setup.jsso its the first file in the plugins dirzzz.jsso its the last file in the middleware dirPotential solutions
Beta Was this translation helpful? Give feedback.
All reactions