Skip to content

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

Draft
ide wants to merge 1 commit into
react:mainfrom
expo:@ide/fantom-report-bundle-load-failure
Draft

ide wants to merge 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 read 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. 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:

Run on this branch (base 94aee19ac9):

node scripts/clang-format.js --check private/react-native-fantom/tester/src/TesterAppDelegate.cpp   # passes
git diff --check upstream/main                                                                       # clean

There is no automated test, because the failure happens before any test code loads. The tester was built on main and on this branch (2026-11-28) and run 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
  • main: libc++abi: terminating due to uncaught exception of type facebook::jsi::JSError: Value is undefined, expected an Object.
  • This branch: libc++abi: terminating due to uncaught exception of type std::runtime_error: Failed to load the JS bundle at /nonexistent/missing.bundle.js.

A bundle that does load still runs: yarn fantom private/react-native-fantom/src/__tests__/Fantom-itest.js passes on this branch.

🤖 Generated with Claude Code

`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

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant