help: plugin breaks devTools
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- nuxt
调研方向
首先,使用所示的 async defineNuxtPlugin 和 CMS store 调用复现从 Nuxt v3 升级到 v4 的过程,然后在 composable 错误出现时检查 devTools 的启动路径。完成的标准是:devTools 能够加载,同时插件可以获取其初始设置和导航内容,而不会出现报告中的 Nuxt 实例错误。
由索引模型根据 Issue 内容生成。
描述
📚 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."
- 主要语言
- TypeScript
- 星标
- 3.3k
- 派生
- 214
- 平均合并
- 19 小时 45 分钟
- 30 天内合并 PR
- 12
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt/devtools 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 3/5 1-2 天 新手友好度 68/100
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
-
bug needs reproduction
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96687 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 条评论 ·