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:
parent
c92bc858f7
commit
ebe39a63e6
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue