You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nuxt navigateTo() never produces a navigates edge: the Vue resolver claims it first #2634
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 → calls → index, i.e. the page itself (resolver vue), and no navigates edge
Route middleware is affected the same way: navigateTo('/login') in middleware/auth.global.ts produces no edge.
Cause
src/resolution/frameworks/vue.ts:36: navigateTo is in NUXT_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: vueResolver is registered before vueRouterResolver.
src/resolution/index.ts:1450: the first framework result with confidence >= 0.9 ends the loop, so the navigateTo handling in vue-router.ts:303 is 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).
Thanks for the precise diagnosis: the resolver order was exactly it.
#2826 is merged to main. Vue Router now reads navigateTo calls, so navigateTo('/x') in pages, components, composables and route middleware links to the page it opens, the way router.push does.
We didn't stop at removing the line from the auto-import list. On real apps like elk, which declares a navigateTo of its own inside a plugin, calls with a computed destination then linked to that unrelated function, so those are now left unlinked instead. An external URL ({ external: true }) also no longer lands on your / page.
It ships in the next release; re-index Nuxt projects after upgrading.
Activity
fix(nuxt): navigateTo('/x') links to the page it opens, as router.pus…
colbymchenry commentedon Oct 23, 2026
Thanks for the precise diagnosis: the resolver order was exactly it.
#2826 is merged to
main. Vue Router now readsnavigateTocalls, sonavigateTo('/x')in pages, components, composables and route middleware links to the page it opens, the wayrouter.pushdoes.We didn't stop at removing the line from the auto-import list. On real apps like elk, which declares a
navigateToof its own inside a plugin, calls with a computed destination then linked to that unrelated function, so those are now left unlinked instead. An external URL ({ external: true }) also no longer lands on your/page.It ships in the next release; re-index Nuxt projects after upgrading.
fix(rust): nuxt navigateTo('/x') links to the page it opens, as route…