Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,13 @@ module.exports.setupDevServer = ({ server, templatePath, onUpdate }) => new Prom
if (firstRun) {
firstRun = false
if (config.copyUrlOnStart) {
require('clipboardy').write(url)
copied = chalk.dim('(copied to clipboard)')
try {
require('clipboardy').write(url)
copied = chalk.dim('(copied to clipboard)')
} catch (e) {
// If we can't copy the link to the clipboard, just ignore the error (but still alert the user)
copied = chalk.dim('(failed to copy to clipboard)')
}
}
}

Expand Down