-
Notifications
You must be signed in to change notification settings - Fork 18
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
Error invoking remote method 'wdio-electron.execute': ReferenceError: __name is not defined after update to wdio 9 and wdio-electron-service 7 #756
Comments
It could be that passing the function to the main process over the IPC boundary it loses some property of the nested function. Did you make this broken simplified function after you updated WDIO or was the code for this test exactly the same in both versions? What happens if you replace the function with |
The simplified function was only used in v7. The original code works in v6 and breaks in v7. I didn't see the point in posting it here since even this small piece of code already displays the same problem. I'll try tomorrow what happens when i try sort suggestion. |
This is a known issue within WebdriverIO (webdriverio/webdriverio#13444) which I am currently working on resolving. ETA for a release is either today or tomorrow. |
Closed as duplicate of the WDIO issue. |
I think this one should be reopened. Here is how to reproduce:
await browser.execute(() => {
const uploadStub = () => 'boom!'
})
Here is the error:
|
We need to find out why the fix in the above WDIO ticket is not working here. Using #763 to work on it. |
Hi @goosewobbler await browser.execute(() => {
const uploadStub = () => 'boom!'
}) with 7.0.2 and, unfortunately, it still fails with:
|
@gavvvr I forgot to update I'm going to need a new example repo showing a failure with |
Closing until I get more evidence that this is still an issue. |
Hello @goosewobbler |
@gavvvr The issue here seems to be that the displayed error is masking the true error, which is that the This explains why it works in the E2Es, because they all enable the bridge. I'm not going to create E2Es which run on a bridgeless app, as we are looking to get rid of it and the rapidly shrinking amount of time I can spend on this service is better spent there. I'll reopen and try to find a more comprehensive fix to improve the error here, otherwise I'll just document it as a known issue. As far as workarounds you can either:
|
Ok, closing again. @gavvvr you were using the wrong function. The test should be calling Since |
@goosewobbler thank you for your analysis of my issue!
Unfortunately, I can't use
From my experience, this is not quite true... The regular I reported for the first time here, when Christian Bromann had already closed the original issue and the problem has disappeared for a similar browser's e2e test using WDIO v9.0.9 + TypeScript. I decided that it's a |
I wasn't clear here - you can't use
Interesting, presumably you can't access Electron APIs that way?
I'm still not convinced it is a service issue as I released |
Still some issue with the version of |
I'm using wdio 9.0.7 and wdio-electron-service 7.0.1.
With 8.40.3 and 6.6.1 I never received this error.
Now tests that use a function defined in a
browser.electron.execute
block fail with the message:I have simplified the function to the following:
replacing this with
and the error is gone.
package.json:
Any workarounds for this? It seems that due to the context I cannot declare the helper function outside of the execute block.
The text was updated successfully, but these errors were encountered: