8000 Properly support file upload errors · Issue #221 · svecosystem/formsnap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Properly support file upload errors #221

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

Closed
moekify opened this issue May 18, 2025 · 1 comment
Closed

Properly support file upload errors #221

moekify opened this issue May 18, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@moekify
Copy link
moekify commented May 18, 2025

Describe the feature in detail (code, mocks, or screenshots encouraged)

It seems that the FieldErrors component doesn't pick up correctly on errors coming from FileUploads (or maybe it's actually about the nested array when requiring multiple files.

FieldErrors errors logged in children render snippet:
{"errors":[],"errorProps":{"data-fs-field-error":""}}
$errors logged from superforms directly
{
  "receipts": {
    "0": [
      "Please upload a file."
    ]
  }
}
zod schema
  receipts: z
    .instanceof(File, { message: "Please upload a file." })
    .refine((f) => f.size < 500_000_000, "Max 5 MB upload size.")
    .array()

What type of pull request would this be?

Enhancement

Provide relevant links or additional information.

https://superforms.rocks/concepts/files

@moekify moekify added the enhancement New feature or request label May 18, 2025
@moekify
Copy link
Author
moekify commented May 18, 2025

Nevermind, it was a problem in my implementation that mostly caused this

@moekify moekify closed this as completed May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant
0