diff --git a/lib/generate.js b/lib/generate.js index 7587d6ff90..99ee140463 100644 --- a/lib/generate.js +++ b/lib/generate.js @@ -52,11 +52,12 @@ export default function () { }) .then(() => { // Resolve config.generate.routes promises before generating the routes - return promisifyRoute(this.options.generate.routes) + return promisifyRoute(this.options.generate.routes || []) .catch((e) => { - console.error(`Could not resolve routes`) // eslint-disable-line no-console + console.error('Could not resolve routes') // eslint-disable-line no-console console.error(e) // eslint-disable-line no-console process.exit(1) + throw e }) }) .then((generateRoutes) => {