[Vuejs]-Vue.js 2 & webpack / npm start opens and reloads in FF instead of Chrome

0đź‘Ť

âś…

Your project is using the open library in order to open a URL in a browser. Specifically this line, in server.js file:

require('open')(`http://localhost:${process.env.PORT}`);

open accepts a second optional argument as the program used to open the URL

require('open')(`http://localhost:${process.env.PORT}`, 'google-chrome');

There is a lack of documentation about what string to pass, another library mentions that it depends on the OS:

The app name is platform dependent. Don’t hard code it in reusable
modules. For example, Chrome is google chrome on macOS, google-chrome
on Linux and chrome on Windows.

So try other strings if “google-chrome” doesn’t work for you.

👤yuriy636

Leave a comment