ef4 / ember-browserify

ember-cli addon for easily loading CommonJS packages from npm via browserify.
MIT License
172 stars 28 forks source link

Add full path to errors with stack traces #129

Closed bryanhickerson closed 6 years ago

bryanhickerson commented 6 years ago

Related issue: https://github.com/ef4/ember-browserify/issues/121

In trying to reproduce the error above, it was unclear what import was causing this failure and it turned out it was happening in a file that didn't have an npm import at all. This should make it easier to identify the source of errors in the future.

Before:

The Broccoli Plugin: [object Object] failed with:
Error: Error parsing code while looking for "npm:" imports: TypeError: Cannot read property 'elements' of undefined
    at findAMDImports (/Users/bryan/dev/betterup-app/frontend/node_modules/ember-browserify/lib/stubs.js:114:6)

After:

The Broccoli Plugin: [object Object] failed with:
Error: Error parsing code while looking for "npm:" imports in file: /Users/bryan/dev/betterup-app/frontend/tmp/stub_generator-input_base_path-RWdqCdT1.tmp/frontend/tests/factories/assessment.js
TypeError: Cannot read property 'elements' of undefined
    at findAMDImports (/Users/bryan/dev/betterup-app/frontend/node_modules/ember-browserify/lib/stubs.js:114:6)
ef4 commented 6 years ago

Thanks! This is published in 1.2.2