superawesomelabs / leo

Highly Extensible, Declarative Static Site Generator
103 stars 6 forks source link

Capture .leorc Errors and show in console #178

Open ChristopherBiscardi opened 7 years ago

ChristopherBiscardi commented 7 years ago

Errors in leo.config.js and similar can cause failure "for cosmicconfig". This results in an error you have to DEBUG out, which is a bad Developer Experience.

DEBUG=*,-babel,-css yarn start
yarn start v0.23.4
$ leo develop
  leo:develop:load-leorc parsing error { Error: Cannot find module 'hljs'
    at Function.Module._resolveFilename (module.js:470:15)
...
sa-labs/leo-core/node_modules/cosmiconfig/lib/loadJs.js:20:15 code: 'MODULE_NOT_FOUND' } +0ms
(node:26871) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: error loading .leorc
(node:26871) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.