-
Notifications
You must be signed in to change notification settings - Fork 674
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
Browser not opening with Yarn PnP #7388
Comments
I believe this might be related to #7327 |
Note: The issue does not happen when |
You are correct that this issue is similar to #7327. Based on the description, it appears to be the same issue. |
I tested this out on another machine of mine and the issue did not happen. The difference between my 2 machines is the one where the issue occurs has the repo on a different drive than the OS (the |
Later today I'll attempt to both reset the yiarn cache on my original machine as well as putting the repo in the system drive to see if either of those fix the issue. |
Running |
I ran with more detailed logging ( |
I have noticed that changing
console.log('TEST before')
await this.pendingResponses[id];
console.log('TEST after') I only see the |
Hi @aboe026, Please clean the |
Unfortunately I'm still seeing the issue after removing the |
Thank you, we will look into it. |
In order to make this "work", I've done the following. It's not exactly a fix, but it does unblock me.
async init() {
await (0, make_dir_1.default)(TempDirectory.TEMP_DIRECTORIES_ROOT);
const tmpDirNames = await this._getTmpDirsList(this.namePrefix);
DEBUG_LOGGER('Found temp directories:', tmpDirNames);
const existingTmpDirFound = await this._findFreeTmpDir(tmpDirNames);
if (!existingTmpDirFound)
await this._createNewTmpDir();
DEBUG_LOGGER('Temp directory path: ', this.path);
await cleanup_process_1.default.init();
await cleanup_process_1.default.addDirectory(this.path);
USED_TEMP_DIRS[this.path] = this;
}
console.info('This version of TestCafe has been patched by <INSERT_NAME_HERE>.')
const fs = require("fs");
for (const dirName of tmpDirNames) {
const fullDirName = path_1.default.join(TempDirectory.TEMP_DIRECTORIES_ROOT, dirName);
try {
fs.rmdirSync(fullDirName, { recursive: true });
console.debug(`Removed temporary directory ${fullDirName}`);
} catch (err) {
console.error(`Error while deleting ${fullDirName}.`, err.message);
}
} Of course, customize the logs to your liking. Strictly speaking, as long as you remove the problematic line, TestCafe should work fine for you. The code I added was simply an approximation to try and do whatever it is that this part of TestCafe is supposed to do normally.
This patch has allowed my group to use both TestCafe 2.0.1 and TestCafe 2.1.0 without issue. |
Hi @Asuza, Thank you for the information. We'll take it into account. |
I think I may have stumbled into the answer based on another bug I thought I had with jest. From @merceyz: It's a bug in Node.js which was fixed in nodejs/node#41221 and shipped in Node.js v14.19.2, v16.14, and v17.4. Upgrading to NodeJS 16.19.0 resolved this bug for me. |
I'm still having this issue with TestCafe 2.3.0 and NodeJS 18.13.0 and 18.14.0. |
Apologies @Asuza, thought the bug I linked would fix the issue for everyone. Re-opening because it still seems to exist on latest LTS |
Duplicate of #7710 |
What is your Scenario?
I would like to run testcafe with a Yarn PnP setup.
What is the Current behavior?
I get the following error when trying to run TestCafe:
What is the Expected behavior?
TestCafe correctly finds my browser and runs the test successfully.
What is your public website URL? (or attach your complete example)
https://github.com/aboe026/testcafe-yarn-browser-connection
What is your TestCafe test code?
Your complete configuration file
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
https://github.com/aboe026/testcafe-yarn-browser-connection#steps-to-reproduce
TestCafe version
2.1.0
Node.js version
v16.13.2
Command-line arguments
testcafe --config-file=.testcaferc.json
Browser name(s) and version(s)
Chrome 107.0.5304.107
Platform(s) and version(s)
Windows 11 Pro 10.0.22621.819
Other
No response
The text was updated successfully, but these errors were encountered: