Skip to content

Commit

Permalink
feat: enable errors to be rendered using match/module
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh committed Jun 15, 2023
1 parent 50ed751 commit f01fa79
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1678,11 +1678,8 @@ export default abstract class Server<ServerOptions extends Options = Options> {
// served by the server.
let result: RenderResult

// We want to use the match when we're not trying to render an error page.
const match =
pathname !== '/_error' && !is404Page && !is500Page
? getRequestMeta(req, '_nextMatch')
: undefined
// Get the match for the page if it exists.
const match = getRequestMeta(req, '_nextMatch')

if (
match &&
Expand Down Expand Up @@ -1724,12 +1721,9 @@ export default abstract class Server<ServerOptions extends Options = Options> {
if (!headers['content-type'] && blob.type) {
headers['content-type'] = blob.type
}
let revalidate: number | false | undefined =
context.staticGenerationContext.store?.revalidate

if (typeof revalidate == 'undefined') {
revalidate = false
}
const revalidate =
context.staticGenerationContext.store?.revalidate ?? false

// Create the cache entry for the response.
const cacheEntry: ResponseCacheEntry = {
Expand Down

0 comments on commit f01fa79

Please sign in to comment.