svrxjs/svrx

xdg-open: not found

Closed this issue · 4 comments

smth commented

Describe the bug
When following the Quick Start guide, after running svrx the server starts but I get the following error:

[error:open] Error: Command failed: xdg-open http://localhost:8000/
/bin/sh: 1: xdg-open: not found

Also, editing files does not reload the browser (not sure if related).

To Reproduce
Steps to reproduce the behavior:

  1. npm install -g @svrx/cli
  2. mkdir example && cd example
  3. echo '<html><body>Hello svrx!</body></html>' > index.html
  4. svrx

Expected behavior
There to not be an error. Perhaps a browser should open?

Desktop
CLI version: 1.1.2
Svrx version: 1.1.4
Node version: v8.17.0
OS version: Linux 4.19.128-microsoft-standard x64

Additional context
I'm using WSL (Windows Subsystem for Linux).

Hi, could you please try

which xdg-open

to make sure you have xdg-open installed?

If not installed, you can try

sudo apt-get install xdg-utils --fix-missing

to installed xdg-open, and let me know if this works :)

smth commented

I can confirm that sudo apt-get install xdg-utils --fix-missing fixes the issue.

I think this will be a separate issue, but just to confirm: When running srvx, editing a file, a CSS file for example, should trigger a browser reload, right? (It doesn't on my machine)

When running srvx, editing a file, a CSS file for example, should trigger a browser reload, right?

Yes. Would you please provide a minimum showcase repository if there's still a problem?

And i'll close the issue, please open a new issue if needed.

Error stack after running see the result :

byteoveflow@ANDRIs-MacBook-Pro ~ % svrx
[svrx] svrx successfully started at

    External: http://100.120.0.3:8000
       Local: http://localhost:8000

     Plugins: proxy,cors,livereload,history-api-fallback,open,serve

node:events:505
      throw er; // Unhandled 'error' event
      ^