Open Maddobun opened 8 months ago
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.
https://github.com/microsoft/playwright/issues/29198 should close this issue, once the PR goes out to playwright release.
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:
But the actual argv is this:
For reference, we slice the argv list here: https://github.com/eclipse-theia/theia/blob/69d7cd017c7509ee9867bd778ee180db20b513f4/dev-packages/application-manager/src/generator/backend-generator.ts#L149
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?