question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find profile directory

See original GitHub issue

Context:

  • GOOD Playwright Version: same version (1.6.2)
  • BAD Playwright Version: same version
  • Operating System: Windows
  • Extra:

Code Snippet

process.env.PLAYWRIGHT_BROWSERS_PATH = "0";
process.env.DEBUG = "pw:browser*";
const { firefox } = require("playwright-firefox");
let page, browser;
export async function startAgent() {
  try {
    browser = await firefox.launch({
      headless: false,
      proxy: { server: "per-context" },
    });
 isStarted = true;
  } catch (e) {
    console.log(e);
  }
}
export async function work(proxy = false) {
  try {
    if (!isStarted) {
      await startAgent();
    }
    let context;
   context = await browser.newContext();
  page = await context.newPage();
 }
}

Describe the bug This is the logs from DEBUG=pw:browser*

  pw:browser <launching> D:\node_projects\pwtest\node_modules\playwright-firefox\.local-browsers\firefox-1205\firefox\firefox.exe -no-remote -wait-for-browser -foreground -profile C:\Users\mypc\AppData\Local\Temp\playwright_firefoxdev_profile-vrPsOp -juggler-pipe -silent +0ms
  pw:browser <launched> pid=23116 +7ms
  pw:browser [out]  +1s
  pw:browser [out] Juggler listening to the pipe +1ms
  pw:browser [err] JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory. +662ms
  pw:browser <gracefully close start> +28s
  pw:browser <kill> +4ms
  pw:browser <process did exit: exitCode=1, signal=null> +288ms
  pw:browser <gracefully close end> +6ms
  pw:browser <launching> D:\node_projects\pwtest\node_modules\playwright-firefox\.local-browsers\firefox-1205\firefox\firefox.exe -no-remote -wait-for-browser -foreground -profile C:\Users\mypc\AppData\Local\Temp\playwright_firefoxdev_profile-92fLz0 -juggler-pipe -silent +717ms
  pw:browser <launched> pid=7208 +5ms
  pw:browser [out]  +1s
  pw:browser [out] Juggler listening to the pipe +1ms
  pw:browser [err] JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory. +680ms
  pw:browser <gracefully close start> +27s
  pw:browser <kill> +3ms
  pw:browser <process did exit: exitCode=1, signal=null> +249ms
  pw:browser <gracefully close end> +4ms

It used to work for me for some time. Had this exact error before. Solved it by reinstalling playwright-firefox setting ``` process.env.PLAYWRIGHT_BROWSERS_PATH = “0”;

it worked for sometime. But its happening again.


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Feb 11, 2021

@devmondo ah, two browsers simultaneously! Awesome, I can repro now! We’ll fix it shortly

0reactions
devmondocommented, Feb 5, 2021

@aslushnikov thanks for the support!

unfortunately i cant share the private code, but it is nothing special really.

import {firefox} from "playwright-firefox";

async function runBrowser(){
const browser = await firefox.launch(); 

await browser.newContext({
        ignoreHTTPSErrors: true,
        viewport: null,
    });
    }
    
 await Promise.all[runBrowser(),runBrowser()];
    

please let me know if i could help more.

thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox can't find profile folder and I tried all fixes found so far.
Go to the folder that holds your Firefox profile(s). It's usually located at %appdata%\Mozilla\Firefox\Profiles and will contain at least one ...
Read more >
"Can't find profile directory" error while running some tests in a ...
Please, advise me. I'm just learning Selenium WebDriver tools and trying to run some tests in a window of Firefox, but the second...
Read more >
Can't find Profile folder [WIN11] : r/firefox - Reddit
I have Firefox installed through the new Microsoft Store. I tried several ways: about:support > Profile Folder > Open FolderResults in ...
Read more >
Where does Firefox (Snap) store the profiles? - Ask Ubuntu
I upgraded to 22.04 yesterday and Firefox has imported my profiles from the original directory inside ~/.mozilla/firefox/ into the new ...
Read more >
How to Copy the Firefox Profile to a New User Profile in ... - 4iT
NOTE: If you can't find any reference to Mozilla, Firefox or profiles in the AppData\Roaming folder of the new user this will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found