Call await renderer.renderToString (context) to report an error when configuring vue ssr.

< H2 > an error was reported when configuring vue ssr server rendering. I have been looking for this error for a long time, but I really don"t know how to solve it. I hope to have some advice < / H2 >.
server-render.js
const ejs = require("ejs")
module.exports = async(ctx, renderer, template) => {
  ctx.headers["Content-Type"] = "text/html"

  const context = { url: ctx.path }
  console.log(ctx.path)
  console.log("renderer", renderer);
  try {
    const appString = await renderer.renderToString(context)
    console.log("appString", appString);
    const {
      title
    } = context.meta.inject()
    const html = ejs.render(template, {
      appString,
      title: title.text(),
      style: context.renderStyles(),
      scripts: context.renderScripts()
    })
    ctx.body = html
  } catch (err) {
    console.log("appString", "errr");
    console.log("render error", err)
    throw err
  }
}
ssr.js
const Router=require("koa-router")
const path=require("path")
const fs=require("fs")
const VueServerRender=require("vue-server-renderer")

const serverRender=require("./server-render")

const clientManifest=require("../../public/vue-ssr-client-manifest.json")
const renderer= VueServerRender.createBundleRenderer(
  path.join(__dirname,"../../server-build/vue-ssr-server-bundle.json"),
  {
    inject:false,
    clientManifest
  }
)
console.log("renderer",renderer)
const template=fs.readFileSync(
  path.join(__dirname,"../server.template.ejs"),
  "utf-8"
)

const pageRouter=new Router()

pageRouter.get("*",async (ctx)=>{
  await serverRender(ctx,renderer,template)
})
module.exports=pageRouter
error message

A renderer.renderToString (context) error was reported by printing

.

put the code in githunb

https://github.com/fridaydream/vue-ssr-example.git

after executing the commands npm run build and npm start , I reported an error

.
Mar.09,2021
The problem of

should be that document. is used in some methods of the Vue file. This kind of js code problem leads to


did the landlord solve it later

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34d57-e495.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34d57-e495.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?