Commit d36118ab authored by Xuezheng Ma's avatar Xuezheng Ma Committed by Tim Neutkens

Check if _document.js returns a react element before using (#2013)

* Check if _document.js returns a react element before using

* Use capital letter R in 'React'
parent 23a48096
...@@ -90,6 +90,7 @@ async function doRender (req, res, pathname, query, { ...@@ -90,6 +90,7 @@ async function doRender (req, res, pathname, query, {
if (res.finished) return if (res.finished) return
if (!Document.prototype || !Document.prototype.isReactComponent) throw new Error('_document.js is not exporting a React element')
const doc = createElement(Document, { const doc = createElement(Document, {
__NEXT_DATA__: { __NEXT_DATA__: {
props, props,
......
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