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

Conversation

JensPfeifle
Copy link
Contributor

@JensPfeifle JensPfeifle commented Nov 18, 2021

↪️ Pull Request

Fix for #6703 by wrapping the Exception thrown by compileToString in a ThrowableDiagnostic.
Unfortunately this doesn't seem to fix #6124.

I looked into using codeframes to get syntax highlighting. Running the elm compiler with --report=json gives usable diagnostic location information, but the error message is still quite verbose, including code snippets (again) and hints. It just didn't look right, so I've left it at printing the stack trace.

💻 Examples

Before

image

After

image

🚨 Test instructions

Start parcel v2 with any broken Elm code, e.g.
Main.elm:

module Main exposing (main)
main =
   i-am-broken

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Nov 18, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@devongovett devongovett merged commit be65b92 into parcel-bundler:v2 Nov 28, 2021
@JensPfeifle JensPfeifle deleted the elm-compiler-fix branch November 29, 2021 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elm + parcel serve unusable: File changes not detected after compilation error
3 participants