Nuxt `navigateTo()` never produces a `navigates` edge: the Vue resolver claims it first
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 90/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nuxtjs, typescript
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Bắt đầu với src/resolution/frameworks/vue.ts và src/resolution/frameworks/vue-router.ts, sau đó xác minh việc phân giải thông qua src/resolution/index.ts. Thêm hoặc cập nhật một bài kiểm thử hồi quy về lập chỉ mục Nuxt bên cạnh __tests__/vue-router.test.ts để bao phủ navigateTo() trong một trang và middleware của tuyến. Hoàn thành nghĩa là cả hai lệnh gọi đều tạo ra cạnh navigates mà không thay đổi hành vi hiện có của router.push.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: codegraph 1.6.2 (bundled runtime, Linux x64), also reproduced on main at baf1906
Project: Nuxt 4 apps (srcDir: app/) in a pnpm monorepo, file-based routes under app/pages/
What happens
The README lists Nuxt's navigateTo among the navigation calls that become navigates edges, but no navigateTo call ever does. router.push in the same project is linked fine.
Minimal repro (3 files, package.json depends on nuxt and vue):
<!-- pages/index.vue -->
<script setup lang="ts">
await navigateTo('/target');
</script>
<template><div /></template>
<!-- pages/push.vue -->
<script setup lang="ts">
const router = useRouter();
function go() { router.push('/target'); }
</script>
<template><button @click="go" /></template>
<!-- pages/target.vue -->
<template><div /></template>
After codegraph init:
pages/push.vue→navigates→/target(resolvervue-router)pages/index.vue→calls→index, i.e. the page itself (resolvervue), and nonavigatesedge
Route middleware is affected the same way: navigateTo('/login') in middleware/auth.global.ts produces no edge.
Cause
src/resolution/frameworks/vue.ts:36:navigateTois inNUXT_AUTO_IMPORTS.vue.ts:127(Pattern 2) resolves any auto-import to the calling node (targetNodeId: ref.fromNodeId) with confidence 1.0.src/resolution/frameworks/index.ts:60-64:vueResolveris registered beforevueRouterResolver.src/resolution/index.ts:1450: the first framework result with confidence >= 0.9 ends the loop, so thenavigateTohandling invue-router.ts:303is never reached.
__tests__/vue-router.test.ts:94 only checks vueNavVerb('navigateTo'), not an indexed Nuxt project, which is why this went unnoticed.
Fix tested
Removing the 'navigateTo' line from NUXT_AUTO_IMPORTS in vue.ts:
| before | after | |
|---|---|---|
| minimal repro | 1 navigates edge (push) |
2 (push + navigateTo) |
| two real Nuxt 4 apps (~60 pages) | 55 navigates edges |
94 (+39 navigateTo, middleware included) |
vue-options-api, vuex-dispatch-synthesizer, vue-resolver-language, vue-store-extraction, vue-template-calls and vue-router test files still pass (41 tests). Reordering the resolvers would likely work too, but the one-line removal is the smallest change.
Expected
navigateTo('/x') produces a navigates edge to the /x route, like router.push('/x'), including from route middleware.
Related
#2473 (another Nuxt auto-import gap in .vue files, about project composables rather than navigateTo).
- Ngôn ngữ chính
- C
- Star
- 73.2k
- Fork
- 4.7k
- Merge trung bình
- 13 giờ 27 phút
- Pull request đã merge (30 ngày)
- 518
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 colbymchenry/codegraph
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Có thể đã có người làm @Ancienttwo đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
colbymchenry/codegraph#2617 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat (v1.6.2)Đang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
colbymchenry/codegraph#2482 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
codegraph ui - does not workĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
colbymchenry/codegraph#1900 · 2 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
colbymchenry/codegraph#1700 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
colbymchenry/codegraph#1535 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của colbymchenry/codegraph
Issue tương tự
-
v9.6.0: CMake incorrectly enforces presence of libevdevCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colonsĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Component component: net
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RT-Thread/rt-thread#11913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
contiki-ng/contiki-ng#3289 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area:docs help wanted type:enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày