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

[Electron Playwright] Theia electron app loader opens the app with multi-root workspace #13325

Open
Maddobun opened this issue Jan 26, 2024 · 2 comments
Assignees

Comments

@Maddobun
Copy link
Contributor

Maddobun commented Jan 26, 2024

One of the issues mentioned in the Electron Playwright PR was that the app would always be launched with a multi-root workspace that contains the electron app dir and the tmp workspace directory initialized by the Theiaworkspace class.

It appears that Playwright prepends two additional arguments to argv when invoking Electron. Our CLI expects the first two argvs to be the electron bin and the app dir, so it fails and interpret the two raw path as input to the WorkspaceCli.

TheiaElectronAppLoader expects electron to be called like this:

Launching Electron with options: {"executablePath":"../electron-app/node_modules/.bin/electron","args":["../electron-app","--no-cluster","--app-project-path=../electron-app","--plugins=local-dir:../plugins","/tmp/cloud-ws-KObxO6"]}

But the actual argv is this:

<absolute_path_to_node_modules>/electron/dist/electron,--inspect=0,--remote-debugging-port=0,../electron-app,--no-cluster,--app-project-path=../electron-app,--plugins=local-dir:../plugins,/tmp/cloud-ws-KObxO6

For reference, we slice the argv list here:

await container.get(CliManager).initializeCli(argv.slice(2),

So normally the only path parameter that's passed into the cli would be the tmp workspace dir, while if launched with playwright the ../electron-app path will also be in this list.

Any comments on how to handle this properly?

@xai
Copy link
Contributor

xai commented Jan 30, 2024

Hello @Maddobun! Thanks for raising this issue!

We need something more dynamic here to handle the arguments injected by Playwright.
So either we have to adjust the TheiaElectronAppLoader to handle and ignore known "playwright arguments" or maybe there is something we can do with the playwright configuration here.

We plan to address this issue as part of our work on Electron Playwright together with the current issues when running on Windows.

@Maddobun
Copy link
Contributor Author

microsoft/playwright#29198 should close this issue, once the PR goes out to playwright release.

@planger planger assigned xai and unassigned planger May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants