help: plugin breaks devTools
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- nuxt
- Lĩnh vực
- developer-experience, devtools
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện quá trình nâng cấp Nuxt v3 lên v4 với async defineNuxtPlugin được示示 và các lệnh gọi đến store của CMS, sau đó kiểm tra đường dẫn khởi động của devTools khi lỗi composable xuất hiện. Được xem là hoàn tất khi devTools tải được trong khi plugin có thể lấy các thiết lập ban đầu và phần điều hướng mà không gặp lỗi Nuxt-instance đã báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
📚 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."
- Ngôn ngữ chính
- TypeScript
- Star
- 3.3k
- Fork
- 214
- Merge trung bình
- 19 giờ 45 phút
- Pull request đã merge (30 ngày)
- 12
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nuxt/devtools
-
fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units) Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
feat: Nuxt devtools for AI Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
bug needs reproduction
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Tất cả issue của nuxt/devtools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bcgov/bc-wallet-mobile#4761 · 1 bình luận ·
-
external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100