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

Fix Elm transform showing compiler errors twice #7326

Merged
merged 2 commits into from Nov 28, 2021
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
13 changes: 12 additions & 1 deletion packages/transformers/elm/src/ElmTransformer.js
Expand Up @@ -56,8 +56,19 @@ export default (new Transformer({
// this can be removed after https://github.com/isaacs/node-graceful-fs/pull/200 was mergend and used in parcel
// $FlowFixMe[method-unbinding]
process.chdir.disabled = isWorker;
let code;
try {
code = await compileToString(elm, elmBinary, asset, compilerConfig);
} catch (e) {
throw new ThrowableDiagnostic({
diagnostic: {
message: 'Compilation failed',
origin: '@parcel/elm-transformer',
stack: e.toString(),
},
});
}

let code = await compileToString(elm, elmBinary, asset, compilerConfig);
if (options.hmrOptions) {
code = elmHMR.inject(code);
}
Expand Down