ember-cli / ember-cli

The Ember.js command line utility.
https://cli.emberjs.com
MIT License
3.26k stars 1.16k forks source link

Improve Build/Template Error Messages #6441

Closed jfelchner closed 1 year ago

jfelchner commented 7 years ago

One of my major OSS initiatives in 2018 is going to be to improve error messages throughout Ember in order to make our lives as developers easier. One of the lowest hanging fruit in regards to improving errors involves the error page that is shown when a build error happens.

The purpose of this issue is to document all of the work that is required to get the error page to the state we think as a community that should be the end result. I'll edit this description as requirements change.

image

There will likely be other error improvements that will fall out of this work at which time I'll create a new issue for those improvements.

Error Structure

Note: This list is what we expect to need from the error object for all of its various use cases.

EmberCLI

Broccoli Only

Examples

stefanpenner commented 7 years ago

https://github.com/broccolijs/broccoli#errors is some related docs, but more detailed work is happening here: https://github.com/broccolijs/broccoli/blob/06438d912ffedd1cf236337569ceae49e9c9e29d/lib/builder.js#L279-L373

and more specifically: https://github.com/broccolijs/broccoli/blob/06438d912ffedd1cf236337569ceae49e9c9e29d/lib/builder.js#L356-L372

stefanpenner commented 7 years ago

cc @joliss

joliss commented 7 years ago

Big :+1: on getting a richer Broccoli error object, and using it to produce better error pages.

We can evolve the Broccoli error API without breakage by adding feature flags to Broccoli's node API and converting old error objects into new error objects and vice versa. (@rwjblue has done this before as well.)

joliss commented 7 years ago

The current structure of Broccoli errors is defined in builder.js:378. The file/treeDir/line/column structure is very rudimentary indeed, and we could clearly extend it as suggested by @jfelchner.

locks commented 1 year ago

Closing as stale. Big changes are coming to CLI's pipeline which the current discussion won't suit. Thank you for all the effforts!