formik
formik copied to clipboard
Formik should not eat up all the errors, without passing them a long
Bug report
Current Behavior
The following conversation explains it.

Expected behavior
The image above explains what I would expect
Reproducible example
https://codesandbox.io/s/formik-codesandbox-template-forked-sfwl3
See the console, the submit does not console.log, but the other added clickable div does. So why does not formik bubbel the error onwards?
Suggested solution(s)
Bubble the error onwards so other code can handle it.
Additional context
Your environment
This problem is on 2.2.6, and as you can see in the reproducable code, also on 1.2.0
| Software | Version(s) |
|---|---|
| Formik | 2.2.6 |
| React | 17 |
| TypeScript | ^4 |
| Browser | chrome |
| npm/Yarn | yarn |
| Operating System | mac |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days
So no response on this? Am I alone on thinking this is an issue?
No, open source moves slowly since people are mostly volunteering their time in the middle of other projects.
I agree the error should propagate, but for backwards compatibility purposes we should probably add like, a strict prop or something that will enable this alternate code path.
If we need to perform other actions after an exception occurs, we should use finally instead of catch. At the very least, we should rethrow
related
- #1122
- #1329
- #3172
I completly undertsand open source goes slow, but I got a notification because of the stale bot, so that is why I raised the issue.
What would be some smart next steps for this @johnrom
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days
I wonder, have no one ever met this issue or considered this to be an issue? I just would like a response from some contributors to the thought of this thing
any thoughts @johnrom
Yes, a screenshot is not accessible to all users, so descriptions of issues should be clearly written in text. Additionally, I already put my thoughts above and it is rude to ping people who aren't actively involved in solving an issue. This isn't an issue I am personally interested in addressing at this time, and my views do not represent those of the repository owner.
Sorry about that john, I have still things to learn in open source, but it just sadens me to see this die or not someone able to explain why I think this is a problem.
I agree it's a weird place to choose to catch an error. I have an entire v3 PR #3231 which needs a few final touches but I haven't gotten any commitments from the repository owners on a path forward, so unfortunately I can't continue putting more effort into this project. After a large project like that, circling around to smaller issues like this seems like a good next step, but once again without commitments I'm not willing to dedicate that time and energy.
@johnrom im sorry to hear that. I think that it might be that maybe the repo owners are overworked then. Because a v3 PR should be prioritized!
Firstly, thanks for the great work on this lib! :wink:
Just wanted to say I face the same issue. When you want a proper uniform handling of all your web app errors in one place thanks to error boundaries (simplifying lots of boilerplates) it feels odd that Formik is catching all submit errors or at least giving an opportunity to bubble these errors as @johnrom suggested. It doesn't seem to be a huge change IMHO.
Can the owners just give us visibility on their intentions / roadmap timeline? @jaredpalmer? (this issue is 1 year old, with no visibility on the project it is hard to involve time for a PR with the high probability of never being merged - 143 opened PR at the time I am writing this)