Run Error - Cannot read properties of undefined (reading 'react')
Closed this issue · 3 comments
I had an error when I made a first run
[ error ] Cannot read properties of undefined (reading 'react')
TypeError: Cannot read properties of undefined (reading 'react')
at /opt/homebrew/lib/node_modules/rnv/src/core/engineManager/index.js:159:36
at Array.forEach (<anonymous>)
at /opt/homebrew/lib/node_modules/rnv/src/core/engineManager/index.js:158:48
at Array.forEach (<anonymous>)
at /opt/homebrew/lib/node_modules/rnv/src/core/engineManager/index.js:153:19
at step (/opt/homebrew/lib/node_modules/rnv/node_modules/tslib/tslib.js:143:27)
at Object.next (/opt/homebrew/lib/node_modules/rnv/node_modules/tslib/tslib.js:124:57)
at /opt/homebrew/lib/node_modules/rnv/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (/opt/homebrew/lib/node_modules/rnv/node_modules/tslib/tslib.js:113:16)
== To Reproduce
ReNative Version: 0.36.1
│ Project Name ($package.name): rnv_test
│ Project Version ($package.version): 0.1.0
│ Workspace ($.workspaceID): rnv
│ Build Scheme (-s): debug
│ Env Info: darwin | arm64 | node v18.20.5
│ Executed Time: 0h:0m:0s:114ms
- rnv new
- @rnv/template-starter (1.8.0)
- rnv run
== Additional context
Also I got at first those warnings :
[ warn ] Platform web requires engine @rnv/engine-rn-next which is not available in engines list
[ warn ] Platform tizen requires engine @rnv/engine-rn-web which is not available in engines list
[ warn ] Platform tvos requires engine @rnv/engine-rn-tvos which is not available in engines list
[ warn ] Platform webos requires engine @rnv/engine-rn-web which is not available in engines list
[ warn ] Platform tizenwatch requires engine @rnv/engine-rn-web which is not available in engines list
[ warn ] Platform kaios requires engine @rnv/engine-rn-web which is not available in engines list
[ warn ] Platform chromecast requires engine @rnv/engine-rn-web which is not available in engines list
[ warn ] Platform linux requires engine @rnv/engine-rn-electron which is not available in engines list
[ warn ] Platform windows requires engine @rnv/engine-rn-electron which is not available in engines list
- So I added manually the engines to renative.json file :
"engines": {
"@rnv/engine-rn": "source:rnv",
"@rnv/engine-rn-next": "source:rnv",
"@rnv/engine-rn-tvos": "source:rnv",
"@rnv/engine-rn-web": "source:rnv",
"@rnv/engine-rn-electron": "source:rnv"
},
Another problem in renative.json
file, is that this rnv.template.json
file does not exist in my machine
"$schema": "../../.rnv/schema/rnv.template.json",
Here's my full renative.json config
{
"platforms": {},
"$schema": "../../.rnv/schema/rnv.template.json",
"bootstrapConfig": {
"rnvNewPatchDependencies": {
"pkg-dir": "7.0.0",
"xmlbuilder": "^15.1.1"
},
"defaultSelectedPlatforms": [
"web",
"ios",
"android"
]
},
"projectName": "rnv_test",
"workspaceID": "rnv",
"defaults": {
"title": "Hello Renative",
"id": "com.mycompany.rnv_test",
"supportedPlatforms": [
"ios",
"android",
"androidtv",
"firetv",
"androidwear",
"web",
"tizen",
"tvos",
"webos",
"macos",
"tizenwatch",
"kaios",
"chromecast",
"linux",
"windows"
]
},
"engines": {
"@rnv/engine-rn": "source:rnv",
"@rnv/engine-rn-next": "source:rnv",
"@rnv/engine-rn-tvos": "source:rnv",
"@rnv/engine-rn-web": "source:rnv",
"@rnv/engine-rn-electron": "source:rnv"
},
"templates": {
"@rnv/template-starter": {
"version": "1.8.0"
}
},
"currentTemplate": "@rnv/template-starter",
"isNew": true,
"isMonorepo": false
}
@MGyahia thanks for reporting this issue, are you using ReNative Version: 0.36.1
?
Could you try to install latest rnv v1.8.0 and then try to create new project? It should work, if not - let me know.
Thank you ! this resolved my issue.
Closing as resolved