Skip to content

使用vue-server-renderer渲染template时编译出错,但是renderToString回调中的err对象为空 #6766

Closed
@imingyu

Description

Version

2.4.4

Reproduction link

https://github.com/imingyu/vue-server-renderer-bug.git

Steps to reproduce

在node端运行下列代码:

const Vue = require('vue')
const app = new Vue({
    template: `<span>123</span> <div>Hello World</div>`
})
const renderer = require('vue-server-renderer').createRenderer()
renderer.renderToString(app, (err, html) => {
    if (err) throw err;//因为模板是不正确的,会报错,但是此处的err对象确实空的
    console.log('success:'+html)
})

What is expected?

编译模板出错时,renderToString的回调函数中第一个参数(err)应该包含错误信息

What is actually happening?

renderToString的回调函数中第一个参数无内容

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions