Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better error logging #926

Open
MikeKovarik opened this issue Mar 9, 2019 · 1 comment · May be fixed by aurelia/router#654
Open

better error logging #926

MikeKovarik opened this issue Mar 9, 2019 · 1 comment · May be fixed by aurelia/router#654

Comments

@MikeKovarik
Copy link

I'm submitting a feature request

  • Library Version:
    aurelia-script 1.3.1

Current behavior:
If you make a typo, or on this case I forgot to add async to a function, you get a long but useless stacktrace pointing to inside of aurelia but nowhere in the stack trace does it give me any clue of what view, class, file is at fault. I've had this issue for years, ever since Aurelia was still in beta and it's been my biggest problem with aurelia ever since. Because despite having .developmentLogging() enabled I'm subjected to tearing my app down and uncommenting it line by line until I find the needle in the haystack

image

Expected Behavior:
Some general information about origin of the error - the file, line, or a class/method

@bigopon
Copy link
Member

bigopon commented Mar 9, 2019

@MikeKovarik thanks for filing this.

The error you got is SyntaxError, so first thing to do would have been looking for ... syntax error.
The reason why it got so long stack is because that module is loaded by Aurelia Router, via dynamic import() api, as I see you are using aurelia-script there. That said, there's thing we can improve in the router, such as checking error, if it's SyntaxError, log a message to give some hint how to debug it, before rethrowing it, if it makes sense.

cc @EisenbergEffect

baerrach pushed a commit to baerrach/router that referenced this issue Sep 5, 2019
baerrach pushed a commit to baerrach/router that referenced this issue Sep 5, 2019
Fix typescript warning by showing error first, stack trace second.

closes aurelia/framework#926
baerrach added a commit to baerrach/router that referenced this issue Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants