1
0
Fork 0
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:
Henrik Wenz 2018-09-18 18:17:35 +00:00 committed by Tim Neutkens
parent ee3a73f80b
commit 8e9b84bf2a
2 changed files with 2 additions and 2 deletions

View file

@ -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
}

View file

@ -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')
}