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

Form validation errors not displayed on Register.vue #1393

Closed
zhongruige opened this issue Oct 30, 2023 · 7 comments · Fixed by inertiajs/inertia#1716
Closed

Form validation errors not displayed on Register.vue #1393

zhongruige opened this issue Oct 30, 2023 · 7 comments · Fixed by inertiajs/inertia#1716
Assignees

Comments

@zhongruige
Copy link

zhongruige commented Oct 30, 2023

Jetstream Version

4.0

Jetstream Stack

Inertia

Laravel Version

10.29.0

PHP Version

8.2.11

Database Driver & Version

No response

Description

Hi there--

I just did a fresh install of the latest Jetstream and Laravel using the inertia stack. I noticed that the error messages aren't showing on the register form as they used to on previous versions. I was able to fix this using defineProps({ errors: Object }) and update the fields from form.errors to errors but wanted to note this issue here, too. It seems like the email field error returns as expected, just not the password errors.

Steps To Reproduce

On a fresh install (using the Inertia stack), register a user with any password that doesn't meet the requirements. Click to register and note that the error doesn't show:

Screenshot 2023-10-30 at 1 31 59 PM

To verify the errors are being caught as expected and just not displayed, add defineProps({ errors: Object }) and update the input errors from form.errors to errors. Try and register again and note that the password error is now showing:

Screenshot 2023-10-30 at 1 31 31 PM
@crynobone
Copy link
Member

The https://inertiajs.com/forms#form-helper documentation seems to suggest current usage is already correct.

@jessarcher
Copy link
Member

This issue exists on Breeze as well.

It only happens with the latest version of Inertia because of this change and because we're calling form.reset to clear the password fields:

    form.post(route('register'), {
        onFinish: () => form.reset('password', 'password_confirmation'),
    });

I will chat with @reinink to confirm whether we should fix it in Inertia or Jetstream and Breeze.

@jessarcher
Copy link
Member

I've reverted the change in Inertia and released v1.0.14.

@zhongruige
Copy link
Author

I've reverted the change in Inertia and released v1.0.14.

Thanks so much for the quick turn around on this @jessarcher! Appreciate it. Fix worked great for me 🙌

Screenshot 2023-11-01 at 7 49 42 AM

@JackHardy
Copy link

@jessarcher I am currently having this same issue using inertiajs/ineria-laravel and laravel-precognition-vue-inertia. Should the PR above have rectified this too? (or is this a me issue)

@jessarcher
Copy link
Member

@JackHardy It should have, yeah. Are you able to replicate the issue on a minimal clean install?

@JackHardy
Copy link

@jessarcher False alarm; apologies.

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

Successfully merging a pull request may close this issue.

4 participants