Skip to content

Commit 8e9b84b

Browse files
HaNdTriXtimneutkens
authored andcommittedSep 18, 2018
Keep warnings when process.env.NODE_ENV is not production (#5196)
This way the warnings will work in test mode. (`process.env.NODE_ENV === „test“`)
1 parent ee3a73f commit 8e9b84b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎lib/error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class Error extends React.Component {
3131
}
3232
}
3333

34-
if (process.env.NODE_ENV === 'development') {
34+
if (process.env.NODE_ENV !== 'production') {
3535
Error.propTypes = {
3636
statusCode: PropTypes.number
3737
}

‎lib/router/router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class Router {
7878
}
7979

8080
const { url, as, options } = e.state
81-
if (process.env.NODE_ENV === 'development') {
81+
if (process.env.NODE_ENV !== 'production') {
8282
if (typeof url === 'undefined' || typeof as === 'undefined') {
8383
console.warn('`popstate` event triggered but `event.state` did not have `url` or `as` https://err.sh/zeit/next.js/popstate-state-empty')
8484
}

0 commit comments

Comments
 (0)
Please sign in to comment.