Skip to content

Commit

Permalink
Apply @mjog's patch so that Vue SFC errors are actually displayed (#8497
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lol768 committed Oct 14, 2022
1 parent e3a39a1 commit 4ebb967
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/core/utils/src/prettyDiagnostic.js
Expand Up @@ -6,7 +6,6 @@ import formatCodeFrame from '@parcel/codeframe';
import mdAnsi from '@parcel/markdown-ansi';
import chalk from 'chalk';
import path from 'path';
import nullthrows from 'nullthrows';
// $FlowFixMe
import terminalLink from 'terminal-link';

Expand Down Expand Up @@ -60,10 +59,10 @@ export default async function prettyDiagnostic(
}

let highlights = codeFrame.codeHighlights;
let code =
codeFrame.code ??
(options &&
(await options.inputFS.readFile(nullthrows(filePath), 'utf8')));
let code = codeFrame.code;
if (code == null && options && filePath != null) {
code = await options.inputFS.readFile(filePath, 'utf8');
}

let formattedCodeFrame = '';
if (code != null) {
Expand Down

0 comments on commit 4ebb967

Please sign in to comment.