software-mansion / react-native-ide

https://ide.swmansion.com
Other
732 stars 25 forks source link

Cannot read properties of undefined (reading 'project') #278

Open vladcristianmarin opened 1 month ago

vladcristianmarin commented 1 month ago

Description When I am launching the IDE window I receive the following error toast in vscode "Cannot read properties of undefined (reading 'project')" and also my log console and breakpoints do not work, I don't see anything attached to the console and breakpoints just do not work. I assume this is why, because of that error.

Environment

jakub-gonet commented 1 month ago

Can you please check for errors and stacktrace from dev tools directly in VSCode (Help > Toggle Developer Tools)?

vladcristianmarin commented 1 month ago
Screenshot 2024-05-22 at 14 21 08

[vscode-app-1716376879580.log] (https://github.com/software-mansion/react-native-ide/files/15402426/vscode-app-1716376879580.log)

TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.yaml. Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json. New grammar file: file:///Users/vlamarin/.vscode/extensions/redhat.vscode-yaml-1.14.0/syntaxes/yaml.tmLanguage.json register @ TMScopeRegistry.ts:46 TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.yaml. Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json. New grammar file: file:///Users/vlamarin/.vscode/extensions/redhat.vscode-yaml-1.14.0/syntaxes/yaml.tmLanguage.json register @ TMScopeRegistry.ts:46 log.ts:419 INFO Started local extension host with pid 51552. log.ts:419 INFO [perf] Render performance baseline is 23ms console.ts:137 [Extension Host] vscode webviewElement.ts:482 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing. mountTo @ webviewElement.ts:482 notificationsAlerts.ts:40 Error: Cannot read properties of null (reading 'project') at r.h (vscode-file://vscode-app/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:153:189812) c @ notificationsAlerts.ts:40

jakub-gonet commented 1 month ago

Hm. Do you have any project that reproduces this issue? You can try installing dev version from main (https://ide.swmansion.com/docs/development). This should give us better stack traces.

Either one will help, I can't repro the problem myself.

janwiebe-jump commented 2 weeks ago

I can reproduce it as follows:

npx create-expo-app StickerSmash --template blank && cd StickerSmash

Open the StickerSmash and open RN IDE panel.

Then I get this error. The thing I noted is that I have multiple VS Code windows with RN projects open. In the debug console I see messages about the react-native-preview that things have already been registered (forgot the exact phrase). When I close all other VS Code windows, restart my vs code, then the RN IDE works, and can launch my project in the integrated emulator