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
c6928dcf
Commit
c6928dcf
authored
Jul 15, 2019
by
Lukáš Huvar
Committed by
Joe Haddad
Jul 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GIP type in `/_error` page (#7952)
parent
60b4e678
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
dynamic.tsx
packages/next-server/lib/dynamic.tsx
+2
-4
_error.tsx
packages/next/pages/_error.tsx
+5
-2
_error.tsx
test/integration/typescript/pages/_error.tsx
+11
-0
No files found.
packages/next-server/lib/dynamic.tsx
View file @
c6928dcf
...
@@ -121,10 +121,8 @@ export default function dynamic<P = {}>(
...
@@ -121,10 +121,8 @@ export default function dynamic<P = {}>(
!
(
dynamicOptions
instanceof
Promise
)
!
(
dynamicOptions
instanceof
Promise
)
)
{
)
{
// show deprecation warning for `modules` key in development
// show deprecation warning for `modules` key in development
if
(
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
process
.
env
.
NODE_ENV
!==
'production'
if
(
dynamicOptions
.
modules
)
{
)
{
if
(
dynamicOptions
.
modules
)
{
console
.
warn
(
console
.
warn
(
'The modules option for next/dynamic has been deprecated. See here for more info https://err.sh/zeit/next.js/next-dynamic-modules'
'The modules option for next/dynamic has been deprecated. See here for more info https://err.sh/zeit/next.js/next-dynamic-modules'
)
)
...
...
packages/next/pages/_error.tsx
View file @
c6928dcf
...
@@ -20,9 +20,12 @@ export type ErrorProps = {
...
@@ -20,9 +20,12 @@ export type ErrorProps = {
export
default
class
Error
<
P
=
{}
>
extends
React
.
Component
<
P
&
ErrorProps
>
{
export
default
class
Error
<
P
=
{}
>
extends
React
.
Component
<
P
&
ErrorProps
>
{
static
displayName
=
'ErrorPage'
static
displayName
=
'ErrorPage'
static
getInitialProps
({
res
,
err
}:
NextPageContext
)
{
static
getInitialProps
({
res
,
err
,
}:
NextPageContext
):
Promise
<
ErrorProps
>
|
ErrorProps
{
const
statusCode
=
const
statusCode
=
res
&&
res
.
statusCode
?
res
.
statusCode
:
err
?
err
.
statusCode
:
404
res
&&
res
.
statusCode
?
res
.
statusCode
:
err
?
err
.
statusCode
!
:
404
return
{
statusCode
}
return
{
statusCode
}
}
}
...
...
test/integration/typescript/pages/_error.tsx
0 → 100644
View file @
c6928dcf
import
{
NextPageContext
}
from
'next'
import
ErrorComponent
from
'next/error'
class
CustomError
extends
ErrorComponent
{
static
async
getInitialProps
({
res
}:
NextPageContext
)
{
const
statusCode
=
500
return
{
statusCode
,
title
:
'CustomError'
}
}
}
export
default
CustomError
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