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: handle early JS errors like in Metro #829

Merged
merged 9 commits into from
Dec 18, 2024
Merged

fix: handle early JS errors like in Metro #829

merged 9 commits into from
Dec 18, 2024

Conversation

jbroma
Copy link
Member

@jbroma jbroma commented Dec 17, 2024

Summary

Closes #621
Closes #794

This PR fixes the problem where early JS errors on iOS would result in a white screen without any meaningful information. Early JS errors are now visible on both platforms inside a LogBox window (parity with Metro).

For now caching of module errors is disabled (as we disable strictErrorModuleHandling in the Target Plugin) and we should handle this in the interceptor as well in the future.

Separate PR should address formatting of the errors to match the presets here (or we could override the whole module and parse LogBoxLog ourselves)

Screenshots

Syntax error showing up in LogBox (although not being parsed correctly, see reason above):

before after
image image

Early JS errors visible on iOS

before after
image image

Test plan

  • - testers show early JS errors

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: 93a4668

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
repack-website ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2024 2:50pm

@jbroma jbroma marked this pull request as ready for review December 18, 2024 12:55
@jbroma
Copy link
Member Author

jbroma commented Dec 18, 2024

added some extra error handling for a rare scenario where there might be no ErrorUtils defined in the global scope 👍

@jbroma
Copy link
Member Author

jbroma commented Dec 18, 2024

thank you for the review @thymikee 🎉

@jbroma jbroma merged commit 617c501 into main Dec 18, 2024
5 checks passed
@jbroma jbroma deleted the fix/early-js-errors branch December 18, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants