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 broken error messages in Jest integration #750

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

alangpierce
Copy link
Owner

The source-map-support library was using a simple regex-based approach to detect the sourceMappingURL string in files, and it had a false positive on the integration file itself. This meant that any crash was showing a JSON parsing error rather on the invalid source map rather than the actual error.

To fix, I hacked the code to build the snippet across two strings. This now shows correct error validation when you have a syntax error or a mistake in your Sucrase configuration, for example.

The source-map-support library was using a simple regex-based approach to detect
the sourceMappingURL string in files, and it had a false positive on the
integration file itself. This meant that any crash was showing a JSON parsing
error rather on the invalid source map rather than the actual error.

To fix, I hacked the code to build the snippet across two strings. This now
shows correct error validation when you have a syntax error or a mistake in your
Sucrase configuration, for example.
@alangpierce alangpierce merged commit d505ae2 into main Oct 6, 2022
@alangpierce alangpierce deleted the fix-jest-transform-error-messaging branch October 6, 2022 07:25
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.

1 participant