Meituan-Dianping/mpvue · error · Error

Content placeholder not found in template.

Error message

Content placeholder not found in template.

What it means

Thrown by parseTemplate when the supplied HTML template string does not contain the content placeholder comment (default <!--vue-ssr-outlet-->). The template renderer splits the page around this marker to inject server-rendered markup; a template lacking it cannot be used for SSR output insertion.

Source

Thrown at src/server/template-renderer/parse-template.js:27

export type ParsedTemplate = {
  head: (data: any) => string;
  neck: (data: any) => string;
  tail: (data: any) => string;
};

export function parseTemplate (
  template: string,
  contentPlaceholder?: string = '<!--vue-ssr-outlet-->'
): ParsedTemplate {
  if (typeof template === 'object') {
    return template
  }

  let i = template.indexOf('</head>')
  const j = template.indexOf(contentPlaceholder)

  if (j < 0) {
    throw new Error(`Content placeholder not found in template.`)
  }

  if (i < 0) {
    i = template.indexOf('<body>')
    if (i < 0) {
      i = j
    }
  }

  return {
    head: compile(template.slice(0, i), compileOptions),
    neck: compile(template.slice(i, j), compileOptions),
    tail: compile(template.slice(j + contentPlaceholder.length), compileOptions)
  }
}

View on GitHub (pinned to 6c5d78ee04)

Solutions

  1. Add <!--vue-ssr-outlet--> inside <body> of the HTML template where the app should mount
  2. If a custom placeholder was configured, ensure the template contains exactly that string
  3. Confirm the correct template file is being loaded and not a stripped/minified variant
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/server/template-renderer/parse-template.js:27 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/718a6a70fb8ecb22. Report an issue: GitHub.