Nuxt `navigateTo()` never produces a `navigates` edge: the Vue resolver claims it first
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nuxtjs, typescript
調査の方向性
src/resolution/frameworks/vue.ts と src/resolution/frameworks/vue-router.ts から始め、その後 src/resolution/index.ts 経由で解決を検証します。__tests__/vue-router.test.ts の近くに Nuxt のインデックス付けの回帰テストを追加または更新し、ページ内の navigateTo() とルートミドルウェアをカバーしてください。完了とは、両方の呼び出しが navigates エッジを生成し、既存の router.push の動作を変更しないことです。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- C
- スター
- 73.2k
- フォーク
- 4.7k
- 平均マージ
- 13時間 27分
- マージ済み PR(30日)
- 518
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
colbymchenry/codegraph のほかの issue
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0対応中かも @Ancienttwo が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
colbymchenry/codegraph#2617 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
colbymchenry/codegraph#2482 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
colbymchenry/codegraph#1900 · コメント 2 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
colbymchenry/codegraph#1700 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
colbymchenry/codegraph#1535 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
colbymchenry/codegraph の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
Update OpenBSD CI to OpenBSD 8.0 and vmactions/openbsd-vm v1.4.9対応中かも @hyoklee が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
v9.6.0: CMake incorrectly enforces presence of libevdev対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信