Nuxt `navigateTo()` never produces a `navigates` edge: the Vue resolver claims it first
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nuxtjs, typescript
- Domain
- developer-experience, tooling
Research direction
Start with src/resolution/frameworks/vue.ts and src/resolution/frameworks/vue-router.ts, then verify resolution through src/resolution/index.ts. Add or update a Nuxt indexing regression test alongside __tests__/vue-router.test.ts to cover navigateTo() in a page and route middleware. Done means both calls produce navigates edges without changing the existing router.push behavior.
Written by the indexing model from the issue text.
Description
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).
- Dominant language
- C
- Stars
- 73.2k
- Forks
- 4.7k
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 418
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from colbymchenry/codegraph
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Possibly taken @Ancienttwo claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
colbymchenry/codegraph#2617 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Under an hour Newbie friendliness 72/100
colbymchenry/codegraph#2482 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
colbymchenry/codegraph#1900 · 2 comments · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
colbymchenry/codegraph#1700 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
colbymchenry/codegraph#1535 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
All issues in colbymchenry/codegraph
Similar issues
-
mewencode: base256[] and base128[] are indexed out of bounds by a non-ASCII octetPossibly taken @kazu-yamamoto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kazu-yamamoto/Mew#276 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
gbdev/homebrewhub-submit#20 ·
-
pluto: extract.c logs cert nickname instead of ckaid when both *cert= and *ckaid= are specifiedPossibly taken @Yash990-bit claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 2 days