Skip to content
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

Open in IDE doesn't work in version 13.13.0 #29820

Closed
bluebellbus opened this issue Jul 9, 2024 · 30 comments · Fixed by #30247
Closed

Open in IDE doesn't work in version 13.13.0 #29820

bluebellbus opened this issue Jul 9, 2024 · 30 comments · Fixed by #30247

Comments

@bluebellbus
Copy link

bluebellbus commented Jul 9, 2024

Current behavior

Version: 13.13.0
IDE:
Version: 1.91.0 (user setup)
Commit: ea1445cc7016315d0f5728f8e8b12a45dc0a7286
Date: 2024-07-01T18:52:22.949Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0

Results:
Nothing happens. Note that I rolled back to cypress version 13.12.0 and the open in IDE link worked fine. Re-installed 13.13.0 and it was again broken.

Desired behavior

open the js file in visual code

Test code to reproduce

I cannot provide this

Cypress Version

13.13.0

Node version

Node.js: 20.9.0

Operating System

OS: Windows_NT x64 10.0.22631

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

@bluebellbus Which button exactly are you clicking in the UI? We have several of these buttons. Can you provide a screenshot?

@jennifer-shehane
Copy link
Member

I was not able to recreate this with the Open in IDE buttons in the test runner when the test was running with some simple tests. I'm also using VS Code.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Jul 9, 2024
@bluebellbus
Copy link
Author

bluebellbus commented Jul 9, 2024

@jennifer-shehane This button with title of the test spec was the button I'm referring to. Not sure if this is relevant, but I am not running cypress cloud.

2024-07-09_13h04_14

@jennifer-shehane
Copy link
Member

There was an update to the launch-editor in 13.13.0 here: #29770 so its possible there is a regression introduced. Maybe it's isolated to Windows. @MikeMcC399 Are you able to recreate in windows?

@MikeMcC399
Copy link
Contributor

@bluebellbus

What is the output of the following commands in the situation where "Open in IDE" does not work for you?

node -v
npx cypress version

You have reported an issue with Cypress 13.3.0, however the discussion is about the later version Cypress 13.13.0 it seems.

Can you confirm that you are running Windows 11 23H2?

@jennifer-shehane

I can't reproduce this issue in Cypress 13.13.0.

@MikeMcC399
Copy link
Contributor

image

@bluebellbus
Copy link
Author

@bluebellbus

What is the output of the following commands in the situation where "Open in IDE" does not work for you?

node -v
npx cypress version

You have reported an issue with Cypress 13.3.0, however the discussion is about the later version Cypress 13.13.0 it seems.

Can you confirm that you are running Windows 11 23H2?

@jennifer-shehane

I can't reproduce this issue in Cypress 13.13.0.

Node: v20.15.0
Cypress Version: 13.13.0
Visual Studio Code: 1.91.0
image

image

@MikeMcC399
Copy link
Contributor

@bluebellbus

It's strange it doesn't work for you. I can only see some small differences in our environment:

Windows 11 Pro / Enterprise
VSCode system setup / user setup

@jennifer-shehane
Copy link
Member

Maybe you could try following these instructions to Clear App Data? You'd have to reset up your IDE of choice I believe after that is cleared.

@bluebellbus
Copy link
Author

@jennifer-shehane I went through all the motions of clearing the app data and resetting the IDE to Visual Code as the instructions suggested. The js file still does not open in VSC. Is there some type of log I can pull that would throw an error for this?

@bluebellbus
Copy link
Author

@jennifer-shehane @MikeMcC399 The Open in IDE also doesn't work in the assertion error here:

image

It is not limited to the orginal button I posted.

@MikeMcC399
Copy link
Contributor

@bluebellbus

I tried on a second Windows system and I was still unable to reproduce.

You may like to try clearing your Cypress cache and reinstalling

npx cypress cache clear
npx cypress install

@bluebellbus
Copy link
Author

@jennifer-shehane @MikeMcC399
Still no luck after cache clear and reinstallation.

@MikeMcC399
Copy link
Contributor

For reference, here are my repro steps

git clone https://github.com/cypress-io/cypress-example-kitchensink
cd cypress-example-kitchensink
npm ci
npx cypress open --e2e --browser electron
  • Select and run test actions.cy.js
  • Test fails (since server is not running)
  • Move mouse over action.cy.js and tooltip "Open in IDE" correctly appears

image

Sorry I don't think I can be of any more help since I am unable to reproduce and I don't know how to debug this UI issue further.

@bluebellbus
Copy link
Author

@jennifer-shehane @MikeMcC399 Is there anything in our cypress.config that could potentially affect this?

@MikeMcC399
Copy link
Contributor

@bluebellbus

Is there anything in our cypress.config that could potentially affect this?

You can test this by using the https://github.com/cypress-io/cypress-example-kitchensink project (see #29820 (comment)). If possible you could try your own project on a different Windows system.

@bluebellbus
Copy link
Author

@MikeMcC399 I can try with that example repo, however I will say my colleague is also experiencing this on his laptop as well with our repo.

@MikeMcC399
Copy link
Contributor

@bluebellbus

Please do check with the example repo. If that has no problem and your repo has issues on more than one laptop, then that is a sign that there is an incompatibility in your repo. To diagnose the incompatibility it would probably need you to share a repo which shows the problem.

@bluebellbus
Copy link
Author

@MikeMcC399 I am not able to able to reproduce the issue when I use the example repo, it works as expected. What I find odd is, if I rollback to 13.12, the Open in IDE works perfectly fine in our repo and has up to this point. I will see about providing our repo, there could be issues with GDPR regarding that.

@MikeMcC399
Copy link
Contributor

@bluebellbus

I am not able to able to reproduce the issue when I use the example repo, it works as expected.

That is an excellent piece of information!

What I find odd is, if I rollback to 13.12, the Open in IDE works perfectly fine in our repo and has up to this point.

I am guessing that there may be some sensitivity to file or path names, perhaps with unusual characters.

I will see about providing our repo, there could be issues with GDPR regarding that.

The ideal repo shared for reproduction purposes contains the minimum amount of content required to reproduce the issue. You should not be sharing any information which has privacy concerns.

@bluebellbus
Copy link
Author

bluebellbus commented Sep 12, 2024

@MikeMcC399 @jennifer-shehane
Update:
In the latest cypress version (13.14.2) this seems to now work when clicking the open in IDE option in the errors here:
image

However it still does NOT work when clicking the Open in IDE option at the top of the test window to open the test spec file here:
image

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Sep 12, 2024

@bluebellbus

Thank you for your screenshots! I can reproduce your issue with a spec filename containing spaces. In that case I get the following error showing in the terminal I used to start Cypress with npx cypress open. The filename was spec with-spaces.cy.js

Could not open spec with-spaces.cy.js in the editor.

When running on Windows, file names are checked against a safe file name pattern to protect against remote code execution > attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, slashes, and underscores.

This seems to be a system restriction. Edit: see next comment

@MikeMcC399
Copy link
Contributor

Not allowing spaces in Windows filenames when launching an IDE is a restriction in launch-editor@2.8.0 currently used by Cypress

"launch-editor": "2.8.0",

"launch-editor": "2.8.0",

This restriction was lifted in launch-editor@2.8.1 released last month.

The latest version is launch-editor@2.9.1 released last week.

@bluebellbus
Copy link
Author

@MikeMcC399 Thanks Mike. Is there a plan to update the launch editor cypress uses in the near future?

@MikeMcC399
Copy link
Contributor

@bluebellbus

Is there a plan to update the launch editor cypress uses in the near future?

That would be a question for @jennifer-shehane . She noted in #29820 (comment) about the previous update, which is now confirmed to have caused a regression in Windows.

There was an update to the launch-editor in 13.13.0 here: #29770 so its possible there is a regression introduced. Maybe it's isolated to Windows.

The Cypress.io team could request Renovate to update launch-editor again.

@jennifer-shehane
Copy link
Member

Opened a PR to bump the launch-editor: #30247

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Sep 18, 2024
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Sep 18, 2024

@MikeMcC399 A binary should be built on this commit (will take some time to build) to test this new fix in Windows, I'd be curious if this fixes it. 1228869

@MikeMcC399
Copy link
Contributor

@bluebellbus

As @jennifer-shehane mentioned, a beta build with the fix for Windows is available.

You may like to install this and test it before the next version of Cypress is released:

npm install https://cdn.cypress.io/beta/npm/13.14.3/win32-x64/develop-12288691982d0084ccd6b55660c871e7d8ea9cad/cypress.tgz

I did a quick test and was able to confirm that Cypress test specs with one or more spaces in their filenames could be opened through the Open in IDE tooltip running in Windows 11.

@jennifer-shehane
Copy link
Member

Thanks @MikeMcC399!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 25, 2024

Released in 13.15.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.15.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants