diff --git a/packages/metro/src/HmrServer/__tests__/HmrServer-test.js b/packages/metro/src/HmrServer/__tests__/HmrServer-test.js index cf6fa15e..ac926db4 100644 --- a/packages/metro/src/HmrServer/__tests__/HmrServer-test.js +++ b/packages/metro/src/HmrServer/__tests__/HmrServer-test.js @@ -158,6 +158,7 @@ describe('HmrServer', () => { message: 'test syntax error', errors: [ { + description: 'test syntax error', filename: 'EntryPoint.js', lineNumber: 123, }, diff --git a/packages/metro/src/JSTransformer/__tests__/Transformer-test.js b/packages/metro/src/JSTransformer/__tests__/Transformer-test.js index 654a3364..181581da 100644 --- a/packages/metro/src/JSTransformer/__tests__/Transformer-test.js +++ b/packages/metro/src/JSTransformer/__tests__/Transformer-test.js @@ -87,7 +87,6 @@ describe('Transformer', function() { const babelError = new SyntaxError(message); babelError.type = 'SyntaxError'; - babelError.description = message; babelError.loc = {line: 2, column: 15}; babelError.codeFrame = snippet; diff --git a/packages/metro/src/Server/__tests__/Server-test.js b/packages/metro/src/Server/__tests__/Server-test.js index 3510b5d5..25f786a5 100644 --- a/packages/metro/src/Server/__tests__/Server-test.js +++ b/packages/metro/src/Server/__tests__/Server-test.js @@ -320,6 +320,7 @@ describe('processRequest', () => { message: 'test syntax error', }); expect(body.errors).toContainEqual({ + description: 'test syntax error', filename: 'testFile.js', lineNumber: 123, }); diff --git a/packages/metro/src/lib/formatBundlingError.js b/packages/metro/src/lib/formatBundlingError.js index 3bbdf9af..6a7155b5 100644 --- a/packages/metro/src/lib/formatBundlingError.js +++ b/packages/metro/src/lib/formatBundlingError.js @@ -24,7 +24,6 @@ const { export type CustomError = Error & {| status?: number, type?: string, - description?: string, filename?: string, lineNumber?: number, errors?: Array<{ @@ -63,7 +62,7 @@ function formatBundlingError( ) { error.errors = [ { - description: error.description, + description: error.message, filename: error.filename, lineNumber: error.lineNumber, },