vuetifyjs/vuetify · error · Error

[Vuetify] Could not find injected goto instance

Error message

[Vuetify] Could not find injected goto instance

What it means

Thrown by useGoTo() when inject(GoToSymbol) is undefined. The goto/scroll instance is created and provided by createVuetify() (via the `goTo` config). Without the Vuetify plugin installed, no goto instance exists to inject.

Source

Thrown at packages/vuetify/src/composables/goto.ts:141

    // Allow for some jitter if target time has elapsed
    if (progress >= 1 && Math.abs(location - container[property]) < 10) {
      return resolve(targetLocation)
    } else if (progress > 2) {
      // The target might not be reachable
      consoleWarn('Scroll target is not reachable')
      return resolve(container[property])
    }

    requestAnimationFrame(step)
  }))
}

export function useGoTo (_options: GoToOptions = {}) {
  const goToInstance = inject(GoToSymbol)
  const { isRtl } = useRtl()

  if (!goToInstance) throw new Error('[Vuetify] Could not find injected goto instance')

  const goTo = {
    ...goToInstance,
    // can be set via VLocaleProvider
    rtl: toRef(() => goToInstance.rtl.value || isRtl.value),
  }

  async function go (
    target: ComponentPublicInstance | HTMLElement | string | number,
    options?: Partial<GoToOptions>,
  ) {
    return scrollTo(target, mergeDeep(_options, options), false, goTo)
  }

  go.horizontal = async (
    target: ComponentPublicInstance | HTMLElement | string | number,
    options?: Partial<GoToOptions>,
  ) => {

View on GitHub (pinned to 8d153908df)

Solutions

  1. Install Vuetify: `app.use(createVuetify())`.
  2. Ensure components using useGoTo() are under the Vuetify app root.
  3. For sub-apps, install Vuetify on each createApp that needs goto.

Example fix

// before
createApp(App).mount('#app')

// after
import { createVuetify } from 'vuetify'
createApp(App).use(createVuetify()).mount('#app')
Defensive patterns

Strategy: type-guard

Validate before calling

import { inject } from 'vue'
import { GoToSymbol } from 'vuetify/composables/goto'
function gotoInstalled(): boolean {
  return inject(GoToSymbol, null) != null
}

Type guard

import { inject } from 'vue'
import { GoToSymbol } from 'vuetify/composables/goto'
function hasGoToProvider(): boolean {
  return inject(GoToSymbol, null) != null
}

Try / catch

try {
  useGoTo()
} catch (e) {
  if (e instanceof Error && /Could not find injected goto instance/.test(e.message)) {
    // install Vuetify, or fall back to native el.scrollIntoView()
  } else throw e
}

Prevention

When it happens

Trigger: Calling useGoTo() in an app where createVuetify() was never installed, or in a component mounted outside the Vuetify-providing app root.

Common situations: Forgetting app.use(vuetify), separate createApp instances without Vuetify, SSR misconfiguration, or duplicate installs breaking symbol identity.

Related errors


AI-assisted analysis of vuetifyjs/vuetify@8d153908df (2026-08-12). Data as JSON: /api/errors/cbc240cb5aa3b0ea. Report an issue: GitHub.