-
-
Notifications
You must be signed in to change notification settings - Fork 637
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
Printing uncaught error messages #288
Comments
Figured out the immediate problem by using the node inspector and pausing on uncaught exceptions. Would be nice if Ink caught those errors and printed them out. |
Couldn't reproduce it with: const Counter = () => throw new Error('Test');
Could you send a minimal reproducible example for this issue? |
I think this acb6ed2 should help. |
This is also happening in our CI, we have gatsby build failing with exit code 1. When reproduced locally we have a memory leak trough Connected to this ticket, when this happens on our CI with gatsby, we get no information, only after weeks of research do we finally understand why this is happening. |
@hlolli Try running Gatsby with the env var |
@wardpeet thanks! I did try --json to enable the json logger, but ink was still being called, was hopeless about it being configureable. So far so good with CI=1, I'll propogate that knowledge to the others in my team on this gatsby project! ADDED: too early to celebrate, we are still getting out of memory crashes, going to check if it's still gatsby-cli/ink/yoga-layout-prebuilt |
bottom line: Despite CI=1, yoga will still fill the heap and crash |
Forget all the noise from me. It was a red herring, that node inspector is totally confusing. After removing ink and yoga_layout from node_modules, I was getting same crash, it will assign percentages / mem-usage to any native module when it's still not related. It seems to be a basic scaling issue, and has nothing to do with the prebuilt yoga-layout modul 🙈 |
Hey @sindresorhus and @KyleAMathews, I'm working on adding a default global error boundary for Ink and trying to decide between versions of UI for displaying errors. I'd appreciate the vote! Rich: Less rich (no code excerpt): Minimal (no prettified stack): Extra minimal (strips out stacks from |
I really like the Rich example but maybe hide the stack like you do with the "extra minimal" one. |
@wardpeet Will go with the rich version! Going to keep the full stack for now to make it more clear what it is. |
Fix is in master, going to keep this issue open until Ink 3 is out. |
I like the rich one too. |
Ink 3 is out with the fix for this issue included! Read the full announcement at https://vadimdemedes.com/posts/ink-3 :) |
Something we struggle with Ink is that it doesn't print syntax errors e.g. we try to access an undefined variable. Instead Ink just exits with an error exit code.
Is this something we've misconfigured or is it Ink that's swallowing errors?
The text was updated successfully, but these errors were encountered: