Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
8e55adf4
Commit
8e55adf4
authored
Oct 21, 2017
by
Tim Neutkens
Committed by
Guillermo Rauch
Oct 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render error as errorHtml (#3142)
parent
4d2ea0ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
render.js
server/render.js
+8
-5
No files found.
server/render.js
View file @
8e55adf4
...
@@ -78,17 +78,20 @@ async function doRender (req, res, pathname, query, {
...
@@ -78,17 +78,20 @@ async function doRender (req, res, pathname, query, {
let
html
let
html
let
head
let
head
let
errorHtml
=
''
let
errorHtml
=
''
try
{
try
{
html
=
render
(
app
)
if
(
err
&&
dev
)
{
errorHtml
=
render
(
createElement
(
ErrorDebug
,
{
error
:
err
}))
}
else
if
(
err
)
{
errorHtml
=
render
(
app
)
}
else
{
html
=
render
(
app
)
}
}
finally
{
}
finally
{
head
=
Head
.
rewind
()
||
defaultHead
()
head
=
Head
.
rewind
()
||
defaultHead
()
}
}
const
chunks
=
loadChunks
({
dev
,
dir
,
dist
,
availableChunks
})
const
chunks
=
loadChunks
({
dev
,
dir
,
dist
,
availableChunks
})
if
(
err
&&
dev
)
{
errorHtml
=
render
(
createElement
(
ErrorDebug
,
{
error
:
err
}))
}
return
{
html
,
head
,
errorHtml
,
chunks
}
return
{
html
,
head
,
errorHtml
,
chunks
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment