webdriverio-community / wdio-vscode-service

A service to test VSCode extensions from end to end using WebdriverIO
https://webdriverio-community.github.io/wdio-vscode-service/
MIT License
29 stars 23 forks source link

Last version of test runner is broken #88

Closed degrammer closed 8 months ago

degrammer commented 8 months ago

It seems the latest version of the test runner is broken, this is due a dependency from vscode-uri that introduced some changes that IMO are breaking and are not properly handled in latest version.

This error is coming from a fresh install of using the command npm create wdio@latest ./

Screenshot 2023-11-08 at 12 44 04 AM
me-rsharma commented 8 months ago

@degrammer I have the same when trying to run test of wdio-vscode-service

Execution of 1 workers started at 2023-11-08T06:00:15.750Z

2023-11-08T06:00:15.832Z DEBUG @wdio/utils:initialiseServices: initialise service "vscode" as NPM package
2023-11-08T06:00:17.522Z INFO @wdio/local-runner: Shutting down spawned worker
2023-11-08T06:00:17.789Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-11-08T06:00:17.790Z INFO @wdio/local-runner: shutting down
Error: Error: Failed to initilialise launcher service unknown: Error: Couldn't initialise "wdio-vscode-service".
TypeError: Cannot destructure property 'URI' of '(intermediate value).default' as it is undefined.
    at file:///C:/Users/rajeshwar.sharma/Cerence/studio/wdio-vscode-service/node_modules/wdio-vscode-service/src/server/utils.ts:6:9      
    at safeImport (file:///C:/Users/rajeshwar.sharma/Cerence/studio/wdio-vscode-service/node_modules/@wdio/utils/build/utils.js:223:15)   
    at async initialisePlugin (file:///C:/Users/rajeshwar.sharma/Cerence/studio/wdio-vscode-service/node_modules/@wdio/utils/build/initialisePlugin.js:31:20)
tzAcee commented 8 months ago

related: #81

mikhail-g commented 8 months ago

the issue is in src/server/utils.ts:6:45 const { URI } = (await import('vscode-uri')).default if you remove .default it will work

Possible fix:

const vscodeUri = await import('vscode-uri')
const { URI } = (vscodeUri.default && vscodeUri.default.default) ? vscodeUri.default : vscodeUri;
christian-bromann commented 8 months ago

A fix for this bug is merged and will be released momentarily.