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

Fresh wdio-vscode-service project is not starting, because of 3.0.8 vscode-uri #81

Closed tzAcee closed 8 months ago

tzAcee commented 9 months ago

Steps to reproduce: Create wdio project for vscode extension testing - npm create wdio ./ Run it - npm run wdio Error:

F:\Projects\webdriver.io\uri-bug>npm run wdio

> wdio
> wdio run ./wdio.conf.ts

Execution of 1 workers started at 2023-10-13T18:31:09.764Z

2023-10-13T18:31:17.841Z INFO @wdio/local-runner: Shutting down spawned worker
2023-10-13T18:31:18.094Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-10-13T18:31:18.095Z 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:///F:/Projects/webdriver.io/uri-bug/node_modules/wdio-vscode-service/src/server/utils.ts:6:9
    at safeImport (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/utils.js:210:15)
    at async initialisePlugin (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialisePlugin.js:32:20)
    at async initialiseServices (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:53:25)
    at async initialiseLauncherService (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:81:26)
    at async Launcher.run (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/cli/build/launcher.js:81:65)
    at initialiseLauncherService (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:118:15)
    at async Launcher.run (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/cli/build/launcher.js:81:65)
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:///F:/Projects/webdriver.io/uri-bug/node_modules/wdio-vscode-service/src/server/utils.ts:6:9
    at safeImport (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/utils.js:210:15)
    at async initialisePlugin (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialisePlugin.js:32:20)
    at async initialiseServices (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:53:25)
    at async initialiseLauncherService (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:81:26)
    at async Launcher.run (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/cli/build/launcher.js:81:65)
    at initialiseLauncherService (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/utils/build/initialiseServices.js:118:15)
    at async Launcher.run (file:///F:/Projects/webdriver.io/uri-bug/node_modules/@wdio/cli/build/launcher.js:81:65)

Workaround is to run npm install vscode-uri@3.0.7

Fault location inside wdio-vscode-service with vscode-uri v3.0.8: 'src/server/utils.ts' line 6:

...
const { URI } = (await import('vscode-uri')).default
...
christian-bromann commented 9 months ago

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

me-rsharma commented 8 months ago

@tzAcee I tried installing vscode-uri@3.0.7 as a workaround but still getting the same error. Is there anything am I missing?

tzAcee commented 8 months ago

@tzAcee I tried installing vscode-uri@3.0.7 as a workaround but still getting the same error. Is there anything am I missing?

The workaround did work for me atleast. Can you check whether the version 3.0.7 of vscode-uri is really installed as a dependency by checking the version inside the package.json of the package inside your node_modules folder?

me-rsharma commented 8 months ago

@tzAcee you are right seems the version in package.json file inside node_modules for vscode-uri is still 3.0.8. But I d o have installed vscode-uri@3.0.7 still its not updated here. I did try making it 3.0.7 manually but not working. Any suggestions how can I make this work?

me-rsharma commented 8 months ago

@tzAcee But there are two places where we find vscode-uri - one inside wdio-vscode-service package folder inside node_moduled and another one is vscode-uri package folder itself inside node_modules folder. And strange thing is at one we do getting 3.0.7 but at another place It's still showing 3.0.8

Screenshot 2023-11-11 at 8 02 10 AM
tzAcee commented 8 months ago

mhm no idea really. Maybe try delete your node_modules folder completly and try npm install again.

The code-wise fix for the problem should be very quick & easy. If I find time this weekend for getting wdio-vscode-service built on my system, I can provide a fix.

me-rsharma commented 8 months ago

@tzAcee I tried deleting node_modules and yarn.lock file and then ran yarn to install dependencies but still getting the same error :(

tzAcee commented 8 months ago

@tzAcee I tried deleting node_modules and yarn.lock file and then ran yarn to install dependencies but still getting the same error :(

Mhm then we'll have to wait till the PR get's merged :D!