aurelia / cli

The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
MIT License
407 stars 133 forks source link

Error: Unhandled "error" event. ([object Object]) in some cases #924

Closed ricardograca closed 2 years ago

ricardograca commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior:

I've renamed all environments to their more verbose counterparts: dev -> development, etc. If I don't specify an environment name when attempting to run any command this results in the following unrelated error message (example for build):

/home/ricardo/src/scratch-dashboard-ui/node_modules/async-done/index.js:18
    throw err;
    ^

Error: Unhandled "error" event. ([object Object])
    at Gulp.emit (events.js:186:19)
    at Object.error (/home/ricardo/src/scratch-dashboard-ui/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
    at handler (/home/ricardo/src/scratch-dashboard-ui/node_modules/now-and-later/lib/mapSeries.js:43:14)
    at f (/home/ricardo/src/scratch-dashboard-ui/node_modules/once/once.js:25:25)
    at f (/home/ricardo/src/scratch-dashboard-ui/node_modules/once/once.js:25:25)
    at tryCatch (/home/ricardo/src/scratch-dashboard-ui/node_modules/async-done/index.js:24:15)
    at done (/home/ricardo/src/scratch-dashboard-ui/node_modules/async-done/index.js:40:12)
    at Domain.onError (/home/ricardo/src/scratch-dashboard-ui/node_modules/async-done/index.js:51:5)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)

There should be a message explaining what the actual error is. It seems like currently all errors are eaten by this unhelpful error message. Possibly related with https://github.com/gulpjs/undertaker/issues/80.

Alexander-Taran commented 6 years ago

latest CLI does provide a meaningful error:

   { Error: File not found with singular glob: C:/Users/atara/repro/aurelia_project/environments/dev.js (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (C:\Users\atara\repro\node_modules\glob-stream\readable.js:84:17)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at Glob.emit (events.js:211:7)
    at Glob._finish (C:\Users\atara\repro\node_modules\glob\glob.js:197:8)
    at done (C:\Users\atara\repro\node_modules\glob\glob.js:182:14)
    at Glob._processSimple2 (C:\Users\atara\repro\node_modules\glob\glob.js:688:12)
    at C:\Users\atara\repro\node_modules\glob\glob.js:676:10
    at Glob._stat2 (C:\Users\atara\repro\node_modules\glob\glob.js:772:12)
    at lstatcb_ (C:\Users\atara\repro\node_modules\glob\glob.js:764:12)

or you can modify your local CLI cli-options.js line 35: let env = this.getFlagValue('env') || process.env.NODE_ENV || 'dev';

Alexander-Taran commented 2 years ago

@3cp can be closed