mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
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“`)
This commit is contained in:
parent
ee3a73f80b
commit
8e9b84bf2a
|
@ -31,7 +31,7 @@ export default class Error extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Error.propTypes = {
|
||||
statusCode: PropTypes.number
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ export default class Router {
|
|||
}
|
||||
|
||||
const { url, as, options } = e.state
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (typeof url === 'undefined' || typeof as === 'undefined') {
|
||||
console.warn('`popstate` event triggered but `event.state` did not have `url` or `as` https://err.sh/zeit/next.js/popstate-state-empty')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue