Skip to content

HelloWorld 0.78.6 UWP app fails to hermes.lib load error on run #14730

Closed
@tero-paananen

Description

@tero-paananen

Problem Description

I created React Native HelloWorld 0.78.6 UWP old arch app and running application on debug fails into hermes.dll try to load msvcp140_app.dll library load error.

Steps To Reproduce

Create following hello world

npx @react-native-community/cli init hello078 --version "0.78.2"
cd hello078
yarn add react-native-windows@0.78.6
npx react-native init-windows --overwrite --template old/uwp-cs-app
yarn install

Check that you really have new arch disabled. There have to be flag <RnwNewArch>false</RnwNewArch> in ExperimentalProperties.props

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="Microsoft.ReactNative Experimental Features">
    <UseHermes>true</UseHermes>
    <UseExperimentalNuget>false</UseExperimentalNuget>
    <ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
    <RnwNewArch>false</RnwNewArch>
  </PropertyGroup>
</Project>

Build debug and run it on Visual Studio 2022.

I get error on application start

Exception thrown at 0x00007FFA318A3028 (msvcp140_app.dll) in hello078.exe: 0xC0000005: Access violation reading location 0x0000000000000000.


Microsoft.ReactNative.dll!Microsoft::ReactNative::SafeLoadLibrary(const wchar_t * fileName, unsigned long dwFlags) Line 33
	at C:\Users\tepaa\Developer\hello078\node_modules\react-native-windows\Shared\SafeLoadLibrary.cpp(33)


 	msvcp140_app.dll!00007ffa318a3028()	Unknown
 	hermes.dll!00007ffa28b01100()	Unknown
 	hermes.dll!00007ffa28931120()	Unknown
 	ucrtbase.dll!00007ffb09aae473()	Unknown
 	hermes.dll!00007ffa28be27a5()	Unknown
 	hermes.dll!00007ffa28be290f()	Unknown
 	ntdll.dll!00007ffb0c089a1d()	Unknown
 	ntdll.dll!00007ffb0c0dd2f7()	Unknown
 	ntdll.dll!00007ffb0c0dd08a()	Unknown
 	ntdll.dll!00007ffb0c0ad947()	Unknown
 	ntdll.dll!00007ffb0c08fbae()	Unknown
 	ntdll.dll!00007ffb0c0873e4()	Unknown
 	ntdll.dll!00007ffb0c086af4()	Unknown
 	KernelBase.dll!00007ffb09c11ea2()	Unknown
>	Microsoft.ReactNative.dll!Microsoft::ReactNative::SafeLoadLibrary(const wchar_t * fileName, unsigned long dwFlags) Line 33	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::LoadLibraryAsPeerFirst(const wchar_t * fileName) Line 69	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::`anonymous namespace'::HermesFuncResolver::HermesFuncResolver() Line 43	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::`anonymous namespace'::initHermesApi() Line 54	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::`anonymous namespace'::getHermesApi() Line 62	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::HermesRuntimeHolder::initRuntime() Line 319	C++
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::HermesRuntimeHolder::getRuntime::__l2::<lambda_1>::operator()() Line 363	C++
 	[External Code]	
 	Microsoft.ReactNative.dll!Microsoft::ReactNative::HermesRuntimeHolder::getRuntime() Line 364	C++
 	Microsoft.ReactNative.dll!facebook::react::`anonymous namespace'::OJSIExecutorFactory::createJSExecutor(std::shared_ptr<facebook::react::ExecutorDelegate> delegate, std::shared_ptr<facebook::react::MessageQueueThread> jsQueue) Line 232	C++
 	Microsoft.ReactNative.dll!facebook::react::NativeToJsBridge::NativeToJsBridge(facebook::react::JSExecutorFactory * jsExecutorFactory, std::shared_ptr<facebook::react::ModuleRegistry> registry, std::shared_ptr<facebook::react::MessageQueueThread> jsQueue, std::shared_ptr<facebook::react::InstanceCallback> callback) Line 114	C++
 	[External Code]	
 	Microsoft.ReactNative.dll!facebook::react::Instance::initializeBridge::__l2::<lambda_1>::operator()() Line 63	C++
 	[External Code]	
 	Microsoft.ReactNative.dll!Mso::React::MessageDispatchQueue::tryFunc(const std::function<void __cdecl(void)> & func) Line 41	C++
 	Microsoft.ReactNative.dll!Mso::React::MessageDispatchQueue::runOnQueueSync::__l2::<lambda_1>::operator()() Line 74	C++
 	Microsoft.ReactNative.dll!Mso::FunctorRef<void __cdecl(void)>::FunctorRefWrapper<`Mso::React::MessageDispatchQueue::runOnQueueSync'::`2'::<lambda_1>>::Invoke() Line 187	C++
 	Microsoft.ReactNative.dll!Mso::FunctorRef<void __cdecl(void)>::operator()() Line 159	C++
 	Microsoft.ReactNative.dll!Mso::React::MessageDispatchQueue::runSync::__l2::<lambda_1>::operator()() Line 56	C++
 	Microsoft.ReactNative.dll!Mso::DispatchTaskImpl<`Mso::React::MessageDispatchQueue::runSync'::`2'::<lambda_1>,`Mso::React::MessageDispatchQueue::runSync'::`2'::<lambda_2>>::Invoke() Line 748	C++
 	Microsoft.ReactNative.dll!Mso::QueueService::InvokeTask(Mso::Functor<void __cdecl(void)> && task, std::optional<std::chrono::time_point<std::chrono::steady_clock,std::chrono::duration<__int64,std::ratio<1,1000000000>>>> endTime) Line 208	C++
 	Microsoft.ReactNative.dll!Mso::LooperScheduler::RunLoop(const Mso::WeakPtr<Mso::LooperScheduler> & weakSelf) Line 59	C++
 	Microsoft.ReactNative.dll!Mso::LooperScheduler::{ctor}::__l1::<lambda_34_>::operator()() Line 37	C++
 	[External Code]	
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.31327.1_x64__8wekyb3d8bbwe\System.Numerics.Vectors.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.31327.1_x64__8wekyb3d8bbwe\System.Runtime.WindowsRuntime.UI.Xaml.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.31327.1_x64__8wekyb3d8bbwe\System.Private.Uri.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Graphics.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Users\tepaa\Developer\hello078\windows\hello078\bin\x64\Debug\AppX\hermes.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\icuuc.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\icuin.dll'. 
'hello078.exe' (Win32): Unloaded 'C:\Windows\System32\icuuc.dll'
'hello078.exe' (Win32): Unloaded 'C:\Windows\System32\icuin.dll'
'hello078.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.30704.0_x64__8wekyb3d8bbwe\vcruntime140_1_app.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug_14.0.30704.0_x64__8wekyb3d8bbwe\msvcp140_app.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\icuuc.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\icuin.dll'. 
'hello078.exe' (Win32): Loaded 'C:\Windows\System32\icu.dll'. 
Exception thrown at 0x00007FFE51063028 (msvcp140_app.dll) in hello078.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

hello078\windows\hello078\packages.lock.json

"dependencies": {
    "UAP,Version=v10.0.17763": {
      "Microsoft.JavaScript.Hermes": {
        "type": "Direct",
        "requested": "[0.0.0-2505.2001-0e4bc3b9, )",
        "resolved": "0.0.0-2505.2001-0e4bc3b9",
        "contentHash": "VNSUBgaGzJ/KkK3Br0b9FORkCgKqke54hi48vG42xRACIlxN+uLFMz0hRo+KHogz+Fsn+ltXicGwQsDVpmaCMg=="
      },

Expected Results

No response

CLI version

15.0.1

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
  Memory: 18.54 GB / 31.90 GB
Binaries:
  Node:
    version: 20.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34607.119 (Visual Studio Community 2022)
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.1
    path: C:\Ruby26-x64\bin\ruby.EXE
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.2
    wanted: 0.78.2
  react-native-windows:
    installed: 0.78.6
    wanted: 0.78.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

None

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions