Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply @mjog's patch so that Vue SFC errors are actually displayed #8497

Merged
merged 1 commit into from Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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