You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This clipboard issue is unfortunately fairly common, ZEIT's serve package logs the same error for example. (but catches the Rejection)
There apparently are ways in userland to make clipboard work in WSL, but afaik all we can do is handle the Exception.
So I'd propose to:
a) catch the error (silently, so project config is shareable without constantly bugging some team members with error messages) and only log "(copied to clipboard)" if the URL was actually copied
b) mention in the docs that --copy isn't supported on some platforms
If we'd switch to writeSync this would be fixed super easily:
try{require('clipboardy').writeSync(urls.localUrlForBrowser)copied=chalk.dim('(copied to clipboard)')}catch(_){/* handle exception in WSL, see issue #3476 */}
otherwise we'd have to wait until the clipboard Promise is settled before we could proceed outputting information (or rethink the message order so we can give clipboard feedback "lazily").
Either way, more than happy to submit a PR. 👍🏻
The text was updated successfully, but these errors were encountered:
Version
3.4.0
Environment info
Steps to reproduce
vue-cli-service serve --copy
(copy option was introduced here)PromiseRejection
is thrownWhat is expected?
a) The local URL is copied to clipboard
b) The serve script doesn't log errors
What is actually happening?
The script throws an
UnhandledPromiseRejection
:or if the user has set the env variable
DISPLAY
:This clipboard issue is unfortunately fairly common, ZEIT's serve package logs the same error for example. (but catches the Rejection)
There apparently are ways in userland to make clipboard work in WSL, but afaik all we can do is handle the Exception.
So I'd propose to:
a) catch the error (silently, so project config is shareable without constantly bugging some team members with error messages) and only log "(copied to clipboard)" if the URL was actually copied
b) mention in the docs that
--copy
isn't supported on some platformsIf we'd switch to
writeSync
this would be fixed super easily:otherwise we'd have to wait until the clipboard Promise is settled before we could proceed outputting information (or rethink the message order so we can give clipboard feedback "lazily").
Either way, more than happy to submit a PR. 👍🏻
The text was updated successfully, but these errors were encountered: