formik icon indicating copy to clipboard operation
formik copied to clipboard

Formik should not eat up all the errors, without passing them a long

Open vongohren opened this issue 4 years ago • 13 comments

Bug report

Current Behavior

The following conversation explains it. image

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

vongohren avatar Apr 13 '21 13:04 vongohren

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

github-actions[bot] avatar May 14 '21 00:05 github-actions[bot]

So no response on this? Am I alone on thinking this is an issue?

vongohren avatar May 14 '21 08:05 vongohren

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

johnrom avatar May 14 '21 15:05 johnrom

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

vongohren avatar May 19 '21 20:05 vongohren

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

github-actions[bot] avatar Jun 19 '21 00:06 github-actions[bot]

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

github-actions[bot] avatar Jul 22 '21 00:07 github-actions[bot]

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

vongohren avatar Aug 13 '21 15:08 vongohren

any thoughts @johnrom

vongohren avatar Aug 13 '21 15:08 vongohren

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.

johnrom avatar Aug 13 '21 15:08 johnrom

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.

vongohren avatar Aug 13 '21 19:08 vongohren

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 avatar Aug 13 '21 20:08 johnrom

@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!

vongohren avatar Aug 18 '21 10:08 vongohren

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)

Jule- avatar May 13 '22 09:05 Jule-