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

"Cypress plugin has crashed click here to reload extension" when launching from non-native terminal #1743

Closed
mattmazzola opened this issue May 18, 2018 · 6 comments

Comments

@mattmazzola
Copy link

mattmazzola commented May 18, 2018

Current behavior:

image

Video of error:
http://recordit.co/mezA4GC015

Desired behavior:

Cypress should execute normally regardless of where it is launched.

Steps to reproduce:

create-react-app cypress-test-js
cd cypress-test-js
npm i -D cypress
> Add 'cypress:open' script to package.json
npm run cypress:open
Click on `example.spec.js` as instructed

Luckily I have seen a similar issue before when I was using Protractor / Selenium and we had the age old case of it's broke on my machine, but works on co-workers and couldn't figure out why.

The key is where you run the npm run cypress:open command.
If I run npm run cypress:open from within VSCode using the PowerShell terminal or the cmd terminal it will fail.
However I open an actual PowerShell or CMD prompt and run npm run cypress:open cypress seems to work fine.

I remember investigating this a bit ago, and we never understood root cause, but there are differences between the environment variables that might have effect.

For example the terminal in VS Code has these extra stuff like which the native terminals do not.

ELECTRON_NO_ATTACH_CONSOLE     1                                                                                                                                                                                              
FPS_BROWSER_APP_PROFILE_STRING Internet Explorer                                                                                                                                                                              
FPS_BROWSER_USER_PROFILE_ST... Default

LANG                           en_US.UTF-8

PROMPT                         $P$G

TERM_PROGRAM                   vscode                                                                                                                                                                                         
TERM_PROGRAM_VERSION           1.23.1

VSCODE_CLI                     1                                                                                                                                                                                              
VSCODE_CWD                     D:\repos                                                                                                                                                                                       
VSCODE_IPC_HOOK                \\.\pipe\9d82e5aa2e1d47f4774f828c8afaf3b5-1.23.1-main-sock                                                                                                                                     
VSCODE_NLS_CONFIG              {"locale":"en-us","availableLanguages":{}}                                                                                                                                                     
VSCODE_NODE_CACHED_DATA_DIR... C:\Users\mattm\AppData\Roaming\Code\CachedData\d0182c3417d225529c6d5ad24b7572815d0de9ac                                                                                                        
VSCODE_NODE_CACHED_DATA_DIR... C:\Users\mattm\AppData\Roaming\Code\CachedData\d0182c3417d225529c6d5ad24b7572815d0de9ac                                                                                                        
VSCODE_NODE_CACHED_DATA_DIR... C:\Users\mattm\AppData\Roaming\Code\CachedData\d0182c3417d225529c6d5ad24b7572815d0de9ac                                                                                                        
VSCODE_PID                     11572

I don't know if any of these are suspicious or why the addition of them would hurt, but I think this issue is an easy problem for new comers to get caught up on since many people use terminals integrated into their editor. Also, one of Cypress's main talking points was that it is easier to get started than traditional/selenium based solutions. I assume it's just oddities with Windows and ROI is low, but it might be an easy fix for someone who is familiar with this stuff.

Or if it is not easily fixed maybe at least the error can be detected so it tells people, you're running from environment X which is not supported, please use Y.

Versions

Windows 10: 10.0.17134 Build 17134
Chrome: 66.0.3359.181 (Official Build) (64-bit)
Cypress: 2.1.0

@brian-mann
Copy link
Member

Because VSCode is also written in Electron, it could be setting environment variables which then conflict with running Cypress. We'll have to investigate, but my guess is anything that has ELECTRON_* in front of it could be causing it.

Since we spawn Cypress out of node through the CLI, that gives us a chance to modify global env vars without affecting the host environment, and we could strip those in conflict. Just need to reproduce on our end.

@brian-mann brian-mann added the stage: needs investigating Someone from Cypress needs to look at this label May 20, 2018
@bhaidar
Copy link

bhaidar commented Jan 24, 2019

Any update on this?

@jennifer-shehane
Copy link
Member

Hey @bhaidar, unfortunately no work has been done on this yet.

@AndyTian-Devops
Copy link

This problem occurs when I run Cypress with admin. And it doesn't repro if I run Cypress without admin.

@ltomes
Copy link

ltomes commented Sep 16, 2019

@v-atian Thanks for the tip, I see the same behavior. At least we have a workaround with that information.

@jennifer-shehane
Copy link
Member

Closing as resolved.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants