Commit ebe39a63 authored by thom's avatar thom Committed by Tim Neutkens

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

parent c92bc858
...@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server' ...@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document { export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) { static async getInitialProps ({ renderPage }) {
const page = renderPage() const page = renderPage()
const styles = renderStatic(() => page.html) const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles } return { ...page, ...styles }
} }
......
...@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server' ...@@ -4,7 +4,7 @@ import { renderStatic } from 'glamor/server'
export default class MyDocument extends Document { export default class MyDocument extends Document {
static async getInitialProps ({ renderPage }) { static async getInitialProps ({ renderPage }) {
const page = renderPage() const page = renderPage()
const styles = renderStatic(() => page.html) const styles = renderStatic(() => page.html || page.errorHtml)
return { ...page, ...styles } return { ...page, ...styles }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment