mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
Add debug for redirect on ssr
This commit is contained in:
parent
d63b34de78
commit
2f2eaac299
@ -59,6 +59,10 @@ export default context => {
|
|||||||
Component._Ctor = Component
|
Component._Ctor = Component
|
||||||
Component.extendOptions = Component.options
|
Component.extendOptions = Component.options
|
||||||
}
|
}
|
||||||
|
// For debugging purpose
|
||||||
|
if (!Component.options.name && Component.options.__file) {
|
||||||
|
Component.options.name = Component.options.__file
|
||||||
|
}
|
||||||
resolve(Component)
|
resolve(Component)
|
||||||
}
|
}
|
||||||
Component().then(_resolve).catch(reject)
|
Component().then(_resolve).catch(reject)
|
||||||
|
@ -71,6 +71,10 @@ export function render (req, res) {
|
|||||||
return html
|
return html
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
if (context.redirected) {
|
||||||
|
console.error(err) // eslint-disable-line no-console
|
||||||
|
return err
|
||||||
|
}
|
||||||
const html = this.errorTemplate({
|
const html = this.errorTemplate({
|
||||||
error: err,
|
error: err,
|
||||||
stack: ansiHTML(encodeHtml(err.stack))
|
stack: ansiHTML(encodeHtml(err.stack))
|
||||||
|
Loading…
Reference in New Issue
Block a user