-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of undefined (reading 'project') #278
Comments
Can you please check for errors and stacktrace from dev tools directly in VSCode (Help > Toggle Developer Tools)? |
[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. |
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. |
I can reproduce it as follows:
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. |
Fixes #278 This PR refactors logic related to opening previews. We were using `showIDEPanel` for `RNIDE.showPanel`/`RNIDE.openPanel` commands, the launch preview depended on the existence of the `fileName` and `lineNumber`. The problem is that VSCode passes its arguments there, but instead number in lineNumber we get an object with the panel's id, which triggers this logic always. Thus, I refactored the opening preview to use a separate command. Additionally, startPreview was running even if the project wasn't set up yet, which led to an error that we used `.project` on `null`. Now, we open the panel and show a warning in that case. ### How Has This Been Tested: Repeat those scenarios for preview both in `tab panel` and `side panel`: **Steps:** - Close the IDE panel - Reopen (or restart if in debug mode) VSCode - Open IDE panel from top right corner **Expected:** The panel opens without error dialog. **Steps:** - Close the IDE panel - Reopen (or restart if in debug mode) VSCode - Click "Open preview" **Expected:** Confirm that panel opens and there is warning message **Steps:** - Make sure IDE Panel is open - Click "Open preview" **Expected:** Confirm that preview started _Tested on react-native-76_
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
The text was updated successfully, but these errors were encountered: