Setup Cypress on WSL ubuntu for windows 10 - reactjs

I am trying to setup Cypress on WSL ubuntu for windows 10 machine. WSL ubuntu does not come up with its own display. Hence, we need to follow few steps before setting up Cypress. I followed all the steps mentioned in the blog here:
https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress
But I keep getting the following error:
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
(Cypress:1690): Gtk-WARNING **: 10:15:51.766: cannot open display: 183.87.117.18:0.0
----------
Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 4.6.0
I have also installed XLaunch for windows 10.
Was anyone able to resolve this issue earlier ? Could anyone please help me resolve this ?
Thanks

Got the idea from here: https://github.com/microsoft/WSL/issues/4106#:~:text=you%20may%20also%20need%20to%20launch%20vcxsrv%20with%20the%20-ac%20argument.
If you have XLaunch running - exit it by double-clicking on the icon in the taskbar and click Exit;
Then open your start menu > right-click XLaunch shortcut > More > Open file location;
Right-click XLaunch shortcut in the Explorer window > Properties;
Add " -ac" without double quotes right after the closing double quote in the Target field - i.e. for me it was "C:\Program Files\VcXsrv\xlaunch.exe" -ac;
Click ok
Now run Cypress again. Yay! Ran for me :)

For me, this was caused by having a WSL1 image (despite having WSL2 installed). You can check via wsl --list --verbose. Follow steps here to convert to WSL2.

Related

Visual Studio Code extensions stopped working suddenly

I'm having problem with my Visual Studio Code. Yesterday I had my pc shut down with VS Code open, and when I turned pc on again, all VS Code extensions stopped working. I'm using React and Typescript in my project and I really need those extensions. My eslint and prettier configurations also stopped working.
If somebody had the same problem please answer.
I had this problem too. You can fix with the following:
Open the command palette (Ctrl + Shift + P)
Run Disable All Installed Extensions
Then run Enable All Extensions.
Restart Visual Studio Code
You can make sure again that the extensions are enabled.
i too had a similar issue, and found (thru trial and error and multiple stackoverflow searches)
fix
toggle Developer Tools once you have vs code open
select the console tab
scroll thru the log, paying close attention to the red errors/
- if it's extension errors, open file explorer and go
$drive:\Users\Yourname.vscode\extensions
delete any problem extensions
Restart VSCode and all should be well (at least for me it was)
cheers and happy coding :)
I had that problem on WSL (Windows Subsystem for Linux). The error was like this:
/mnt/c/Users/Admin/.vscode/extensions/ms-vscode-remote.remote-wsl-0.63.13/scripts/wslCode.sh: 69: /home/raul/.vscode-server-server/bin/5554b12acf27056905806867f251c859323ff7e9/bin/code: not found
The solution was to go to Windows PowerShell and open Visual Studio Code, then go to the extensions and restart the Remote - WSL extension, and go back to WSL. It then started working immediately.
in my case removing "Todo Tree" plugin which is one of the VS Code plugins solved the problem,
https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree
if it is installed uninstall it and the problem will be solved
It's weird. when I use WSL2 terminal opening Visual Studio Code, an exception occurs, expressing that wslCode.sh: 69.
But when I open Visual Studio Code in Windows, then type code . in WSL2 terminal, it works without an exception.
Please check if you are able to turn on your settings sync. I had an issue like this and I couldn't even access the account option on vs code (the second last icon on the right horizontal panel.
If not (it's a long shot) try uninstalling vs code and reinstalling VS Code completely. I used these commands to do so (works for mac)
This happened to me in the portable version (1.73.3). I deleted the extensions folder {vscode root}/data/extensions. Re-installing all extensions afterwards worked for me

browser does not launch on running react project on wsl (zsh)

I am working on a simple react project on Windows 10 Pro. On trying to run the project with wsl with zsh (npm start) everything works, I get warnings and compilation is done without any errors. The issue I am facing is automatic launch of browser from wsl is not happening.
If I manually open localhost:3000 on my chrome after this command everything works but I would like the wsl terminal to launch my browser on npm start automatically just like it does in most of my other terminals and powershell on windows.
What I have tried:
added a export browser property to my .zshrc with path to chrome from here
Added a bsconfig file to root with following code to set open = true as per from here
I have added the ports from 3000-3999 to my firewall so that wsl can access my host (localhost ip). this fixed previous issue where localhost:3000 would show connection refused error.
I would be happy to provide any more details.
I am very new to wsl and zsh and I would really appreciate any help. Thanks

“choregraphe-suite-2.8.6.23-mac64-setup” cannot be opened because the developer cannot be verified

I am trying to install Choregraphe Suite on my macOS Catalina (v10.15.7) from the softbankrobotics website but I get this message:
Website link: https://developer.softbankrobotics.com/nao6/naoqi-developer-guide/choregraphe-suite/choregraphe-suite-installation-guide#desktop-installation
I don't know what I'm missing in order to run the installation on my laptop. I would appreciate it if anyone can help me on this.
Update: I left clicked it and it opened in command line. I went into the choregraphe-folder/bin/naoqi-bin and when I executed the file I got this:
Last login: Sat Nov 7 09:05:34 on ttys000
/Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
name#Mahlas-MBP ~ % /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin ; exit;
dyld: Library not loaded: #rpath/QtCore.framework/Versions/5/QtCore
Referenced from: /Users/name/EEP_work/choregraphe-suite-2.8.6.23-mac64/bin/naoqi-bin
Reason: image not found
zsh: abort
[Process completed]
Thanks :)
You can go to the system settings > security & privacy and explicitly allow the opening of the installer (screenshot attached).
allow opening of installer
It will then bring up a second dialog:
"macOS cannot verify the developer of “choregraphe-suite-2.8.6.23-mac64-setup”. Are you sure you want to open it?
By opening this app, you will be overriding system security which can expose your computer and personal information to malware that may harm your Mac or compromise your privacy."
You can then click on "Open", but for my Mac (10.15.7) the installer crashes directly afterwards and I cannot install anything.
allow installation
It seems impossible to install Choregraphe on a recent Mac OS X. Help would be much appreciated.
'Allow install from internet' is the step you have to go over for all 3rd party apps(always happening) for macs. But still 'choregraphe' setup file didn't worked.
I hope my solution helps, i searched a lot too :)
install not setup file, try binaries oneenter image description here, and unzip. Open file you will see 'choregraphe' unix executable file, i clicked that file and app worked, best
P.s. i am not expert or anything that is only way i was able to make it work for my MacOs 10.15.7 (Catalina)

Apex replay debugger is throwing Java 8 is required to run

I am following this trail and I have completed all the steps correctly. Even I able to download the debug logs.
But Problem occurs when I am trying to run the following command
> SFDX: Launch Apex Replay Debugger with Current File
It shows the below error.
But, the thing is, I have jdk-12.0.1 installed on my PC. After that, I have installed the Java 8 also and thus jdk-1.8.0_181 is also installed.
My Java Home setting in VS code is following
I have also restarted my PC, But no luck. It is throwing the same error.
How to solve this ?
You have to set the path as 'C://Program Files//Java//jdk1.8.0_181' and then restart the vs code
In case any Mac users needed help:
I installed Java 11 and then ran this code:
/usr/libexec/java_home -v 11 to find the exact directory and then pasted it in the user settings you have marked with a red rectangle. Then I restarted VS code and it worked.
Edit: Looked at your screenshots...
You did this: C:\Program Files\Java\jdk1.8.0_181
You wanted this: C:/Program Files/Java/jdk1.8.0_181
From the Trailhead unit you linked:

Configure Vagrant with Xvfb Error

I am configuring a vagrant machine with ubuntu 14.04, for doing some tests with selenium and protractor. I want to run all tests in that machine without having a graphic environment. So i only need a plain output by a terminal.
I am following next resources to do that :
http://linkeshkannavelu.com/2015/07/10/virtualization-using-vagrant-for-selenium-tests/comment-page-1/#comment-838
https://www.exratione.com/2013/12/angularjs-headless-end-to-end-testing-with-protractor-and-selenium/
but when i access to vagrant machine and i try to run my tests i get next error message :
[1796:1796:0212/145406:ERROR:browser_main_loop.cc(256)] Gtk: Locale not supported by C library.
Using the fallback 'C' locale.
[1796:1796:0212/145406:ERROR:browser_main_loop.cc(256)] Gtk: cannot open display:
And i am not sure what i should do...
thanks in advance !!
See this article: https://linuxmeerkat.wordpress.com/2014/10/17/running-a-gui-application-in-a-docker-container/
Gtk: cannot open display
is a common error, as states on this page:
DISPLAY has wrong value or you forgot to export it
Also doublecheck if xvfb is running in backgroud/as service.

Resources