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

TypeError with Valibot Schema in version v2.20.1 #518

Closed
batudmr opened this issue Nov 26, 2024 · 1 comment
Closed

TypeError with Valibot Schema in version v2.20.1 #518

batudmr opened this issue Nov 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@batudmr
Copy link

batudmr commented Nov 26, 2024

Description

After upgrading Superforms to version 2.20.1, receiving TypeError during form submission when using Valibot (v0.42.1) for schema validation. The error occurs during the schema validation step, suggesting an incompatibility between these versions.

Error

Uncaught (in promise) TypeError: schema.~run is not a function
    at safeParseAsync (sveltekit-superforms_adapters.js?v=7c5b67fa:70319:39)
    at *validate2 (sveltekit-superforms*adapters.js?v=7c5b67fa:70721:24)
    at Object.validate (sveltekit-superforms_adapters.js?v=7c5b67fa:70739:31)
    at Form_validate (sveltekit-superforms.js?v=317e4ddc:1585:32)
    at validateForm (sveltekit-superforms.js?v=317e4ddc:2312:24)
    at sveltekit-superforms.js?v=317e4ddc:2316:30
    at HTMLFormElement.handle_submit (forms.js?v=39aa00a4:154:11)

Environment

  • Superforms: v2.20.1
  • Valibot: v0.42.1

Reproduction steps

  1. Install Superforms v2.20.1 and Valibot v0.42.1
  2. Create a form with Valibot schema
  3. Submit the form in SPA mode
  4. Error occurs during validation showing schema.~run is not a function

Workaround

Downgrading to Superforms v2.20.0 fixes the issue. Schema validation works correctly with this version.

@batudmr batudmr added the bug Something isn't working label Nov 26, 2024
@ciscoheat
Copy link
Owner

v2.20.1 requires a later version of valibot. Release notes: https://github.com/ciscoheat/sveltekit-superforms/releases/tag/v2.20.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants