From 4ceced9cccc3bcb9737d715e525a7d67c993cab3 Mon Sep 17 00:00:00 2001 From: Lazizbek Ergashev Date: Tue, 17 Nov 2026 22:33:54 +0500 Subject: [PATCH] Name the right env var in Fantom's heap snapshot error ## Summary: When a JS heap snapshot fails because Hermes has no memory instrumentation, `takeJSMemoryHeapSnapshot` tells you to run Fantom with `FANTOM_ENABLE_MEMORY_INSTRUMENTATION=1`. Fantom reads `FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION`, and global setup rejects any other `FANTOM_` variable, so following the hint stops the run with "Unexpected Fantom environment variable". This makes the message name the variable Fantom actually reads. Fixes #60063 ## Changelog: [INTERNAL] [FIXED] - Name the right env var in Fantom's heap snapshot error ## Test Plan: Ran the Fantom Jest config with `FANTOM_ENABLE_MEMORY_INSTRUMENTATION=1`: global setup throws "Unexpected Fantom environment variable". With `FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION=1` it gets past validation and stops on the expected "Memory instrumentation is not supported in CI or OSS environments" check, so the new hint points at the accepted variable. Message-only change. Differential Revision: D132533350 Pull Request resolved: https://github.com/react/react-native/pull/60065 --- private/react-native-fantom/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/react-native-fantom/src/index.js b/private/react-native-fantom/src/index.js index 2d5ee250438..943472e4257 100644 --- a/private/react-native-fantom/src/index.js +++ b/private/react-native-fantom/src/index.js @@ -791,7 +791,7 @@ export function takeJSMemoryHeapSnapshot(): void { // a very specific shape). errorMessage += ' If you want to take JS heap snapshots in optimized builds, ' + - 'please call Fantom with FANTOM_ENABLE_MEMORY_INSTRUMENTATION=1 ' + + 'please call Fantom with FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION=1 ' + '(only works locally with Buck).'; }