在做Vue-SSR时候报错信息如下:
throw new Error("Content placeholder not found in template.")
^
Error: Content placeholder not found in template.
at parseTemplate (F:\vue-ssr-todo\ssr-example\node_modules\_vue-server-renderer@2.6.11@vue-server-renderer\build.dev.js:8788:11)
at new TemplateRenderer (F:\vue-ssr-todo\ssr-example\node_modules\_vue-server-renderer@2.6.11@vue-server-renderer\build.dev.js:8881:9)
at createRenderer (F:\vue-ssr-todo\ssr-example\node_modules\_vue-server-renderer@2.6.11@vue-server-renderer\build.dev.js:9146:26)
at createRenderer$1 (F:\vue-ssr-todo\ssr-example\node_modules\_vue-server-renderer@2.6.11@vue-server-renderer\build.dev.js:9604:10)
at createBundleRenderer (F:\vue-ssr-todo\ssr-example\node_modules\_vue-server-renderer@2.6.11@vue-server-renderer\build.dev.js:9521:20)
at Object.<anonymous> (F:\vue-ssr-todo\ssr-example\server.js:25:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
解决方案在index.html中的body中插入
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!--vue-ssr-outlet-->
</body>
</html>