Webpack: opn(uri) cause error then launch dev server in environment without browser

Created on 17 Nov 2016  路  3Comments  路  Source: vuejs-templates/webpack

Vue.js version

2.0.7

Steps to reproduce

$ docker run -it --rm alpine:latest
$ apk add --no-cache nodejs
$ npm install vue-cli
$ vue init webpack test
$ cd test 
$ npm install
$ npm run dev

What is Expected?

App starts

What is actually happening?
dev server is not starting beacuse server try to open window with running app

JS Error
(node:15) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

Most helpful comment

That behaviour is customizable since Nov 12, 2017 in /config/index.js

All 3 comments

Well, feel free to remove the line if that does not suit your usecase. It's a template, you should adjust it to your needs.

We feel that opening the window is a nice helper for most scenarios, so I don't see a reason to remove this.

While I agree with @LinusBorg that we everyone is able to make the template fit to their needs, I think this is a bit more complicated than that. For instance, those of us with a Chromebook that run their dev environment in a chroot (with Crouton) will experience the same error as Chrome is not detected from within the chroot. While there are options to open Chrome anyway, I totally understand that Vue will not implement such platform-specific workarounds.

I do however think it's important that if there is no browser detected, the error will be ignored.

That behaviour is customizable since Nov 12, 2017 in /config/index.js

Was this page helpful?
0 / 5 - 0 ratings