{"record":{"id":"718a6a70fb8ecb22","repo":"Meituan-Dianping/mpvue","slug":"content-placeholder-not-found-in-template","errorCode":null,"errorMessage":"Content placeholder not found in template.","messagePattern":"Content placeholder not found in template\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/server/template-renderer/parse-template.js","lineNumber":27,"sourceCode":"export type ParsedTemplate = {\n  head: (data: any) => string;\n  neck: (data: any) => string;\n  tail: (data: any) => string;\n};\n\nexport function parseTemplate (\n  template: string,\n  contentPlaceholder?: string = '<!--vue-ssr-outlet-->'\n): ParsedTemplate {\n  if (typeof template === 'object') {\n    return template\n  }\n\n  let i = template.indexOf('</head>')\n  const j = template.indexOf(contentPlaceholder)\n\n  if (j < 0) {\n    throw new Error(`Content placeholder not found in template.`)\n  }\n\n  if (i < 0) {\n    i = template.indexOf('<body>')\n    if (i < 0) {\n      i = j\n    }\n  }\n\n  return {\n    head: compile(template.slice(0, i), compileOptions),\n    neck: compile(template.slice(i, j), compileOptions),\n    tail: compile(template.slice(j + contentPlaceholder.length), compileOptions)\n  }\n}\n","sourceCodeStart":9,"sourceCodeEnd":43,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/server/template-renderer/parse-template.js#L9-L43","documentation":"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.","triggerScenarios":"Thrown at src/server/template-renderer/parse-template.js:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add <!--vue-ssr-outlet--> inside <body> of the HTML template where the app should mount","If a custom placeholder was configured, ensure the template contains exactly that string","Confirm the correct template file is being loaded and not a stripped/minified variant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}