diff --git a/pages/_error-debug.js b/pages/_error-debug.js index 8913db2c4fd23..c24537c10c782 100644 --- a/pages/_error-debug.js +++ b/pages/_error-debug.js @@ -1,7 +1,5 @@ import React from 'react' import ansiHTML from 'ansi-html' -import Head from 'next/head' -import style from 'next/css' export default class ErrorDebug extends React.Component { static getInitialProps ({ err }) { @@ -12,21 +10,47 @@ export default class ErrorDebug extends React.Component { render () { const { name, message, stack, path } = this.props - return
- - +
} } @@ -35,40 +59,6 @@ const encodeHtml = str => { return str.replace(//g, '>') } -const styles = { - body: style({ - background: '#a6004c', - margin: 0 - }), - - errorDebug: style({ - height: '100vh', - padding: '16px', - boxSizing: 'border-box', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center' - }), - - message: style({ - fontFamily: '"SF Mono", "Roboto Mono", "Fira Mono", menlo-regular, monospace', - fontSize: '10px', - color: '#fbe7f1', - margin: 0, - whiteSpace: 'pre-wrap', - wordWrap: 'break-word' - }), - - heading: style({ - fontFamily: '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif', - fontSize: '13px', - fontWeight: 'bold', - color: '#ff84bf', - marginBottom: '20px' - }) -} - // see color definitions of babel-code-frame: // https://github.com/babel/babel/blob/master/packages/babel-code-frame/src/index.js diff --git a/pages/_error.js b/pages/_error.js index 192173aa90d0a..6dc371635fe4a 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -1,5 +1,4 @@ import React from 'react' -import style from 'next/css' export default class Error extends React.Component { static getInitialProps ({ res, xhr }) { @@ -13,54 +12,53 @@ export default class Error extends React.Component { ? 'This page could not be found' : (statusCode ? 'Internal Server Error' : 'An unexpected error has occurred') - return
-
- {statusCode ?

{statusCode}

: null} -
-

{title}.

+ return
+
+ {statusCode ?

{statusCode}

: null} +
+

{title}.

-
- } -} + +
+ } } diff --git a/test/integration.test.js b/test/integration.test.js index bc089918fae51..97de0683d89d8 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -67,8 +67,8 @@ describe('integration tests', () => { test('error 404', async () => { const html = await render('/non-existent') - expect(html).toMatch(/

404<\/h1>/) - expect(html).toMatch(/

This page could not be found\.<\/h2>/) + expect(html).toMatch(/

404<\/h1>/) + expect(html).toMatch(/

This page could not be found\.<\/h2>/) }) test('finishes response', async () => {