Meituan-Dianping/mpvue · error

Failed to resolve ${type.slice(0, -1)}: ${id}

Error message

Failed to resolve ${type.slice(0, -1)}: ${id}

What it means

Fires in resolveAsset after exhaustive lookup fails: the requested id was searched on options[type] (components/directives/filters) as-is, camelized, and PascalCase-capitalized, including the prototype chain (globally registered assets). This is a generic asset-resolution failure guard — the template/compiler referenced a component, directive or filter (per the type argument) by an id that was never registered locally or globally, so resolution returns undefined and rendering falls back to treating the tag as an unknown/native element.

Source

Thrown at src/core/util/options.js:368

  type: string,
  id: string,
  warnMissing?: boolean
): any {
  /* istanbul ignore if */
  if (typeof id !== 'string') {
    return
  }
  const assets = options[type]
  // check local registration variations first
  if (hasOwn(assets, id)) return assets[id]
  const camelizedId = camelize(id)
  if (hasOwn(assets, camelizedId)) return assets[camelizedId]
  const PascalCaseId = capitalize(camelizedId)
  if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]
  // fallback to prototype chain
  const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
  if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
    warn(
      'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
      options
    )
  }
  return res
}

View on GitHub (pinned to 6c5d78ee04)

Solutions

  1. Register the asset: locally via components: { MyComponent } or globally via Vue.component/Vue.directive/Vue.filter
  2. Check the id spelling — Vue tries exact, camelCase and PascalCase variants, but other differences (e.g. 'mycomp' vs 'my-comp') will not match
  3. Verify the registration happens before the consuming component renders (import order, async loading race)
  4. If it's a third-party component, install its plugin (Vue.use) before use
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/core/util/options.js:368 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Meituan-Dianping/mpvue@6c5d78ee04 (2026-09-02). Data as JSON: /api/errors/1affdaae2cc3c5cc. Report an issue: GitHub.