-
Notifications
You must be signed in to change notification settings - Fork 186
Description
๐ What are you trying to do?
I have a project I'm upgrading from Nuxt v3 to v4. My app requires plugins that make the call to the CMS for intiial settings and Data etc. When I add my plugin
/* get global page data on start */
export default defineNuxtPlugin(async (nuxtApp) => {
const siteSettingsStore = useSiteSettingsStore();
await siteSettingsStore.fetchStoreSettings();
const siteNavigation = useSiteNavigationStore();
await siteNavigation.fetchStoreNavigation();
// Add all the stores to the Nuxt context
nuxtApp.provide("siteSettingsStore", siteSettingsStore);
nuxtApp.provide("siteNavigation", siteNavigation);
});
to the app devTools is no longer available...
๐ What have you tried?
Any change I make to the plugin code, namely adding app:created hook, or removing the async/await results the following error
"A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function."
โน๏ธ Additional context
I also get the following error in the browser console.
"The resource http://localhost:3000/_nuxt/builds/meta/dev.json was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally."