Skip to content

Report the bundle path when the Fantom tester's JS bundle fails to load - #60364

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
expo:@ide/fantom-report-bundle-load-failure
Nov 30, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
expo:@ide/fantom-report-bundle-load-failure

Conversation

@ide

@ide ide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

When the Fantom tester cannot load its JS bundle, it aborts with an error that does not mention the bundle. With a bundle path that does not exist:

E… JSBigString.cpp:97] JSBigFileString::fromPath - Could not open file: /path/that/does/not/exist.bundle.js
libc++abi: terminating due to uncaught exception of type facebook::jsi::JSError: Value is undefined, expected an Object

TesterAppDelegate::loadScript ignores the false that ReactHost::loadScript returns, so the tester goes on to look up $$RunTests$$ in a runtime that has evaluated nothing.

TesterAppDelegate::loadScript now throws a std::runtime_error that names the bundle path. This also applies with --interactive, which before went on to its loop with nothing loaded. The tester still aborts, and its last line states the cause:

libc++abi: terminating due to uncaught exception of type std::runtime_error: Failed to load the JS bundle at /path/that/does/not/exist.bundle.js

Changelog:

[INTERNAL] [FIXED] - Report the bundle path when the Fantom tester's JS bundle fails to load

Test Plan:

There is no automated test, because the failure happens before any test code loads. Build the tester and run it with a bundle path that does not exist:

./gradlew :private:react-native-fantom:buildFantomTester
private/react-native-fantom/build/tester/fantom_tester --bundlePath /nonexistent/missing.bundle.js --featureFlags '{}' --minLogLevel error

On main it ends with the JSError above; on this branch with std::runtime_error: Failed to load the JS bundle at /nonexistent/missing.bundle.js. A bundle that loads still runs: yarn fantom private/react-native-fantom/src/__tests__/Fantom-itest.js passes. clang-format passes.

`TesterAppDelegate::loadScript` ignored the result of
`ReactHost::loadScript`. When the bundle could not be read, the tester
went on to look up `$$RunTests$$` in a runtime that had evaluated
nothing, and aborted with "JSError: Value is undefined, expected an
Object", which says nothing about the bundle.

Throw a `std::runtime_error` that names the bundle path when loading
fails. The tester still aborts, and its last line now states the cause.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2026
@ide
ide marked this pull request as ready for review November 29, 2026 12:02
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 29, 2026

@chrfalch chrfalch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can be approved.

One optional nit for the description: interactive mode (main.cpp) goes through the same loadScript, so the REPL now also aborts when its bundle fails to load, where before it entered its loop anyway. runRepl.js always passes a freshly built bundle, so this should rarely matter, but it's worth a line in the description.

@meta-codesync

meta-codesync Bot commented Nov 30, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D135074056.

@rubennorte rubennorte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
meta-codesync Bot merged commit e72be4b into react:main Nov 30, 2026
113 of 115 checks passed
@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 30, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ide in e72be4b

When will my fix make it into a release? | How to file a pick request?

@ide
ide deleted the @ide/fantom-report-bundle-load-failure branch December 1, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants