A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuejs/vue/issues/6766 below:

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

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的回调函数中第一个参数无内容


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4