-
Notifications
You must be signed in to change notification settings - Fork 938
Description
Environment
System:
OS: Windows 11 10.0.26100
CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13700H
Memory: 9.10 GB / 31.68 GB
Binaries:
Node:
version: 20.19.5
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 11.7.0
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
Android NDK: 22.1.7171670
Windows SDK: Not Found
IDEs:
Android Studio: AI-251.27812.49.2514.14217341
Visual Studio:
- 17.10.35027.167 (Visual Studio Community 2022)
Languages:
Java:
version: 18.0.1.1
path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.1.2
wanted: ^20.1.2
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.77.0
wanted: 0.77.0
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Description
I am using react native 0.77 without expo , I used to have react native cli 15 but recently it had vulnerabilities so I upgraded it to v20 but I when I run npm start it shows an error for an unhandled undefined situation
TypeError: Cannot read properties of undefined (reading 'handle')
at Function.use (D:\MobileApp\node_modules\connect\index.js:87:21)
at exports.runServer (D:\MobileApp\node_modules\metro\src\index.flow.js:146:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.runServer [as func] (D:\MobileApp\node_modules\react-native\node_modules\@react-native\community-cli-plugin\dist\commands\start\runServer.js:144:26)
at async Command.handleAction (D:\MobileApp\node_modules\@react-native-community\cli\build\index.js:139:9)
This error goes away if I have cli15 or if I add the below addition to my package json
"postinstall": "node -e \"const fs=require('fs');const f='node_modules/@react-native/community-cli-plugin/dist/commands/start/middleware.js';let c=fs.readFileSync(f,'utf8');c=c.replace('community.indexPageMiddleware;','community.indexPageMiddleware ?? noopNextHandle;');fs.writeFileSync(f,c);\""
}