1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Display errors when using glamor/server in a custom document (#3804)

This commit is contained in:
thom 2018-02-14 18:05:02 +01:00 committed by Tim Neutkens
parent c92bc858f7
commit ebe39a63e6
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const page = renderPage()
const styles = renderStatic(() => page.html)
const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles }
}

View file

@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) {
const page = renderPage()
const styles = renderStatic(() => page.html)
const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles }
}