Meituan-Dianping/mpvue · error

${msg}

Error message

${msg}

What it means

This is warnOnce, the SSR bundle renderer's de-duplicating warning wrapper: a red-colored console.warn used for one-time diagnostics during server-side rendering (called from renderComponent and similar paths). The template is a generic sentinel — it wraps any msg string with ANSI red color codes and a leading/trailing newline — so the actual fault is only identifiable from the interpolated message content; the 'warned' map ensures each distinct message is only printed once per render pass.

Source

Thrown at src/server/render.js:24

  isTrue
} from 'shared/util'

import { escape } from 'web/server/util'
import { SSR_ATTR } from 'shared/constants'
import { RenderContext } from './render-context'
import { ssrCompileToFunctions } from 'web/server/compiler'
import { installSSRHelpers } from './optimizing-compiler/runtime-helpers'

import {
  createComponent,
  createComponentInstanceForVnode
} from 'core/vdom/create-component'

let warned = Object.create(null)
const warnOnce = msg => {
  if (!warned[msg]) {
    warned[msg] = true
    console.warn(`\n\u001b[31m${msg}\u001b[39m\n`)
  }
}

const normalizeRender = vm => {
  const { render, template, _scopeId } = vm.$options
  if (isUndef(render)) {
    if (template) {
      Object.assign(vm.$options, ssrCompileToFunctions(template, {
        scopeId: _scopeId
      }))
    } else {
      throw new Error(
        `render function or template not defined in component: ${
          vm.$options.name || vm.$options._componentTag || 'anonymous'
        }`
      )
    }
  }

View on GitHub (pinned to 6c5d78ee04)

Solutions

  1. Inspect the inner msg text of the printed warning to identify the real SSR problem (often unhandled render errors or missing assets during server rendering)
  2. Reproduce with verbose SSR logging (renderer.renderToString callbacks, bundleRenderer options like runInNewContext tweaks) to get the component trace
  3. Fix the underlying component issue surfaced by the wrapped message — the wrapper itself needs no code change
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/server/render.js:24 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/ea20f26d21d155f9. Report an issue: GitHub.