playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG]Playwright _electron.launch fails to load browser

Open donPab opened this issue 2 years ago • 3 comments

What is causing Playwright to have these problems? A) Main problem is that _electron.launch fails to load the browser and return the app screen. B) console.log(‘psg-xxx’); debugging statements are bypassed or never printed. C) electron.asar Invalid Package D) EyeDropper is not defined When run from package.json ‘scripts’ without Playwright, none of the above are problems.

System info

VSCode Version: 1.78.0 (system setup) Date: 2023-05-03T20:09:00.748Z Electron: 22.4.8 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19044 Sandboxed: Yes playwright --version Version 1.32.1

Source code

Link to the GitHub repository with the repro (https://github.com/donPab/Pencil-Playwright ) Create your own local folder, and run git clone https://github.com/donPab/Pencil-Playwright.git Get Pencil_Playwright dependencies: $ npm install

Steps to recreate-- use VSCode-- Run without Playwright in package.json, select Debug "start": or "start:dev": Run with Playwright in Terminal, run npx playwright test play21launch.test.ts (this gets only blinking-P [for Pencil] on screen, and never completes)

DevTools-Actual-with-Playwright--failing.txt DevTools-Expeted-without-Playwright.txt ActualResults Screenshot-ActualResults ExpectedResults Menu screen, press upper left 3-bars to see dropdown menu Screenshot-ExpectedResults

donPab avatar May 17 '23 21:05 donPab

@donPab I get a lot of errors in the console and blinking "P" when running it with npm run start.

Example errors:

UNCAUGHT EXCPTION ReferenceError: fs is not defined
    at config.js:48

UNCAUGHT EXCPTION TypeError: Config.define is not a function
    at capture-services.js:12

UNCAUGHT EXCPTION ReferenceError: path is not defined
    at __extend (Common.js:17)
    at ToolBar.js:5

What I did:

git clone https://github.com/donPab/Pencil-Playwright.git
cd Pencil-Playwright
npm install
npm run start

Should I run some build script? Note that npm run dist and npm run dist:osx both fail with the following error:

<redacted>/distosx-bb5c69c4.sh: line 1: ./node_modules/.bin/build: No such file or directory

dgozman avatar May 19 '23 20:05 dgozman

Hi Dmitry,

Thanks for taking a look at this.

I also get three UNCAUGHT EXCEPCTIONs, but it goes on past the blinkingP and gets to the menu.

Maybe I have an OOPS--

Perhaps I need to say

CD \Pencil-Playwright\app

and then from there do the

npm install

and do the npm run start

How do I edit the git issue to add an explicit CD \Pencil-Playwright\app ?

I just tried from \Pencil-Playwright to do npm run start and got-->

./node_modules/.bin/electron ./app

'.' is not recognized as an internal or external command,

operable program or batch file.

because it was using the original package.json, and not the app\package.json

I have never tried the npm run dist

Tkx, Paul

From: Dmitry Gozman @.> Sent: Friday, May 19, 2023 1:19 PM To: microsoft/playwright @.> Cc: donPab @.>; Mention @.> Subject: Re: [microsoft/playwright] [BUG]Playwright _electron.launch fails to load browser (Issue #23102)

@donPab https://github.com/donPab I get a lot of errors in the console and blinking "P" when running it with npm run start.

Example errors:

UNCAUGHT EXCPTION ReferenceError: fs is not defined at config.js:48

UNCAUGHT EXCPTION TypeError: Config.define is not a function at capture-services.js:12

UNCAUGHT EXCPTION ReferenceError: path is not defined at __extend (Common.js:17) at ToolBar.js:5

What I did:

git clone https://github.com/donPab/Pencil-Playwright.git cd Pencil-Playwright npm install npm run start

Should I run some build script? Note that npm run dist and npm run dist:osx both fail with the following error:

/distosx-bb5c69c4.sh: line 1: ./node_modules/.bin/build: No such file or directory

— Reply to this email directly, view it on GitHub https://github.com/microsoft/playwright/issues/23102#issuecomment-1555191065 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHORIBRRLUE6FXHR7UNIODXG7ITZANCNFSM6AAAAAAYFUTEBE . You are receiving this because you were mentioned.Message ID: @.***>

donPab avatar May 19 '23 21:05 donPab

@donPab I did not really understand your comment. Is there any question you'd like to ask? If not, I will close this issue, since it looks like no action item from the Playwright side.

dgozman avatar May 22 '23 15:05 dgozman