diff --git a/private/react-native-fantom/runner/bundling.js b/private/react-native-fantom/runner/bundling.js index cb57a93dc816..de334ec28ccd 100644 --- a/private/react-native-fantom/runner/bundling.js +++ b/private/react-native-fantom/runner/bundling.js @@ -52,9 +52,19 @@ export async function createBundle(options: BundleOptions): Promise { ); if (lastBundleError || lastBundleResult?.ok !== true) { - throw new Error( - `Failed to request bundle from Metro: ${lastBundleError?.message ?? (await lastBundleResult?.text()) ?? ''}`, - ); + let errorMessage = + lastBundleError?.message ?? (await lastBundleResult?.text()) ?? ''; + + try { + const parsed = JSON.parse(errorMessage); + if (typeof parsed.message === 'string') { + errorMessage = parsed.message; + } + } catch { + // Not JSON — use the raw text as-is. + } + + throw new Error(`Failed to request bundle from Metro:\n${errorMessage}`); } await fs.promises.writeFile(