Closed degrammer closed 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)
related: #81
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;
A fix for this bug is merged and will be released momentarily.
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 ./