Description
Problem Description
My app runs fine in Debug, but when I try to run it in Release mode I get errors no matter the configuration. It was first because of reanimated (which compiled fine in Debug?) so I got rid of it. I disabled minification, and with Hermes disabled, I get a globalThis is not defined error (I have generated a certificate so it's not that) (I enabled UseDeveloperSupport
to see the redbox in Release). I enabled Hermes to see if there was a better callstack, but with Hermes it doesn't run at all and it says it's missing a index.windows.bundle.packager.map
file.
Below is the redbox error I get if I don't have Hermes enabled.
ReferenceError: 'globalThis' is not defined
setupURLPolyfill (Unknown script
code:182446:4
Anonymous function (Unknown script
code: 182410:5
loadModuleImplementation (Unknown script
code: 205:6
guardedLoadModule (Unknown script
code:136:6
metroRequire (Unknown script
code: 64:4
Anonymous function (Unknown script
code: 182221:2
loadModuleImplementation (Unknown script
code: 205:6
guardedLoadModule (Unknown script
code: 136:6
metroRequire (Unknown script
code: 64:4
Anonymous function (Unknown script
code: 178907:2
Steps To Reproduce
- Set mode to Release in Visual Studio
- App fails to build
Expected Results
App runs just like it does when it's in Debug mode
CLI version
11.3.6
Environment
System:
OS: Windows 10 10.0.22621
CPU: (20) x64 Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
Memory: 18.35 GB / 31.87 GB
Binaries:
Node:
version: 18.16.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 9.5.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.14393.0
- 10.0.17134.0
- 10.0.17763.0
- 10.0.18362.0
- 10.0.19041.0
- 10.0.22000.0
- 10.0.22621.0
IDEs:
Android Studio: Not Found
Visual Studio:
- 15.9.33529.398 (Visual Studio Enterprise 2017)
- 17.5.33530.505 (Visual Studio Community 2022)
- 17.6.33723.286 (Visual Studio Professional 2022)
- 16.11.33529.622 (Visual Studio Community 2019)
Languages:
Java:
version: 17.0.8.1
path: C:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
react-native-windows:
installed: 0.72.10
wanted: 0.72.10
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Release
Snack, code example, screenshot, or link to a repository
No response