react-native: [Windows] 0.76.0 and 0.76.1 Turbo Module Error EarlyJsError: TurboModuleRegistry.getEnforcing(...) [module name] could not be found. Verify that a module by this name registered in the native binary

Description

When created a Turbo Module with exact same steps as mention in React Native Official Docs, the app builds but then shows the error EarlyJsError: TurboModuleRegistry.getEnforcing(…) [module name] could not be found. Verify that a module by this name registered in the native binary.

Note: Platform is windows 11 (the react native app folder is already in exclusion from windows defender) Running on a physical device : Realme 11 pro 5g (Android 14) mode: developement

WhatsApp Image 2024-11-05 at 9 52 11 AM

Steps to reproduce

  1. git clone https://github.com/CodeWithBlaze/TurboModuleExampleWIthError
  2. npm install
  3. npm run android

React Native Version

0.76.0

Affected Platforms

Runtime - Android

Areas

TurboModule - The New Native Module System

Output of npx react-native info

System:
  OS: Windows 11 10.0.22631
  CPU: (8) x64 Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
  Memory: 523.30 MB / 7.84 GB
Binaries:
  Node:
    version: 20.13.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.18
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.8.1
    path: ~\AppData\Roaming\npm\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7678000
  Visual Studio: Not Found
Languages:
  Java: javac 17
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0
    wanted: 0.76.0
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

EarlyJsError:

TurboModuleRegistry.getEnforcing(...): 'NativeLocalStorage' could not be found.

Verify that a module by this name is registered in the native binary., stack: invariant@2006:26

getEnforcing@2700:28

anonymous@104125:81

loadModulelmplementation@267:14

guardedLoadModule@175:38

metroRequire@89:92

anonymous@104044:63

loadModulelmplementation@267:14

guardedLoadModule@175:38

metroRequire@89:92

anonymous@1112:48

loadModulelmplementation@267:14

guardedLoadModule@168:47

metroRequire@89:92

global@104135:4

Reproducer

https://github.com/CodeWithBlaze/TurboModuleExampleWIthError

Screenshots and Videos

WhatsApp Image 2024-11-05 at 9 52 11 AM

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 41 (5 by maintainers)

Most upvoted comments

Thank you @cortinico for helping out so much in this issue. Let me know if i can help you out in any way (although i don’t know much android)

Closing as this has been resolved. If you have other specific questions or issues, please open a separate bug report.

@cavadibrahimli1 Bro firstly no sir, friend or bro works 😁. Second dosen’t matter where you run this command as yarn will be installed globally and will be available in all projects. But just to answer your question yes, I ran it in my project directory using cmd in administrator mode.

@cavadibrahimli1 I didn’t solved it yet neither tried with yarn and powershell. I am out of home, once I reach home then I will try and update here.

@cortinico thank you so much for testing it on windows. I will do a test using yarn and powershell from my side. Like I have no clue why is it not working on my system. But appreciate your help

My main goal is just running one cpp code in my app. But I think, this issue is all about a bug @CodeWithBlaze

@CodeWithBlaze I tested same on Windows, and I have same issue.