open: Error launching chrome from WSL

I’m getting an error when trying to use open@7.3.0 in WSL in a project built with @open-wc, @web/dev-server

This error doesn’t happen with open@7.2.1.

Steps to reproduce:

  1. Create a new project using:

npm init @open-wc --type scaffold --scaffoldType wc --features linting testing demoing --typescript true --scaffoldFilesFor testing demoing --tagName ui-element --writeToDisk true --installDependencies npm cd ui-element 2. run with npm start

The following error is displayed.

[web-dev-server] Error: spawn wslvar ENOENT [web-dev-server] at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19) [web-dev-server] at onErrorNT (internal/child_process.js:469:16) [web-dev-server] at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[web-dev-server] errno: ‘ENOENT’, [web-dev-server] code: ‘ENOENT’, [web-dev-server] syscall: ‘spawn wslvar’, [web-dev-server] path: ‘wslvar’, [web-dev-server] spawnargs: [ ‘systemroot’ ], [web-dev-server] cmd: ‘wslvar systemroot’, [web-dev-server] stdout: ‘’, [web-dev-server] stderr: ‘’ [web-dev-server] }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I believe this is due to the tests being asynchronous and not being able to correctly handle that (@sindresorhus as the maintainer can hopefully confirm that assumption).

Correct. I gave up on the automatic tests.

It seems open@7.3.0 requires

  1. https://github.com/wslutilities/wslu to be installed.
  2. powershell.exe exists in PATH.

Some new OS like Ubuntu had it included which some isn’t (like Debian I am using).