Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Improve stacktrace for failed dependency loading #397

Closed
guybedford opened this issue Jun 12, 2015 · 4 comments
Closed

Improve stacktrace for failed dependency loading #397

guybedford opened this issue Jun 12, 2015 · 4 comments

Comments

@guybedford
Copy link
Member

Originally posed by @OliverJAsh in systemjs/systemjs#512:

This is what the errors looks like when a dependency fails to load:

Potentially unhandled rejection [3] Internal Server Error: <dependency>
    Error loading <dependency> from <requester>
    Error loading <dependency> (WARNING: non-Error used)

Sometimes dependency is a nested dependency of a dependency of requester, e.g. requester -> foo -> bar -> dependency. Is it possible to show the immediate requester (bar)?

@nyarly
Copy link

nyarly commented Jun 22, 2015

Looking at an issue in systemjs/builder, I found that the right way to address that would be here. I think load objects would need to be extended to include their (first?) immediate requester, and their un-normalized requested name (i.e. "requested as") in order to report these errors usefully.

I've started (i.e. 15 minutes to fork, clone, write a failing test) work on a PR for this.

@guybedford
Copy link
Member Author

I think this can be done via some reflective lookups in the error handler itself to run a dependency trace just for the error message.

@guybedford
Copy link
Member Author

Thanks @nyarly for your work on this.

@guybedford
Copy link
Member Author

Released in 0.17.4.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants