diff --git a/lib/dev-server.js b/lib/dev-server.js index 80dfe0e..2ea8a89 100644 --- a/lib/dev-server.js +++ b/lib/dev-server.js @@ -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)') + } } }