From f70fb2fd360d673f36def8c0baab79eceda6a384 Mon Sep 17 00:00:00 2001 From: James Ide Date: Sat, 28 Nov 2026 02:36:43 -0800 Subject: [PATCH] Report the bundle path when the Fantom tester's JS bundle fails to load `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 --- private/react-native-fantom/tester/src/TesterAppDelegate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/private/react-native-fantom/tester/src/TesterAppDelegate.cpp b/private/react-native-fantom/tester/src/TesterAppDelegate.cpp index 7738540eabd0..fa2200c9da20 100644 --- a/private/react-native-fantom/tester/src/TesterAppDelegate.cpp +++ b/private/react-native-fantom/tester/src/TesterAppDelegate.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -169,7 +170,9 @@ void TesterAppDelegate::loadScript( const std::string& bundlePath, const std::string& sourcePath) { LOG(INFO) << "Loading script: " << bundlePath << " source " << sourcePath; - reactHost_->loadScript(bundlePath, sourcePath); + if (!reactHost_->loadScript(bundlePath, sourcePath)) { + throw std::runtime_error("Failed to load the JS bundle at " + bundlePath); + } reactHost_->runOnRuntimeScheduler( [this](jsi::Runtime& runtime) { runtime_ = &runtime; });