-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FileUpload: Property objectURL
does not exist on type File
#7136
FileUpload: Property objectURL
does not exist on type File
#7136
Comments
@ewenjo the typing is correct as /**
* Gets the current files list.
* @return {File[]} Current files.
*/
public getFiles(): File[]; Node.js defines that interface File extends _File {}
var File: typeof globalThis extends {
onmessage: any;
File: infer T;
} ? T
: typeof import("node:buffer").File; So it seems like the Node definition is out of date or incorrect. |
Wouldn't the correct type be? File & { objectURL?: string } As the code is conditionally extending the primereact/components/lib/fileupload/FileUpload.js Lines 130 to 131 in 513af5e
I don't believe |
AHHH i see that is a custom property for use in FileUpload. Yeah it probably should be then... Want to submit a PR? |
Sure, I might have some time later today |
objectURL
does not exist on type File
objectURL
does not exist on type File
I think File is used in a few places in the |
Yes, that was my thought as well |
Describe the bug
Property
objectURL
does not exist on typeFile
Reproducer
https://stackblitz.com/edit/vitejs-vite-gc9s8d?file=src%2FApp.tsx
System Information
Steps to reproduce the behavior
1: Access fileupload files, such as with
fileupload.getFiles()
2: Attempt to use
file.objectURL
property.Expected behavior
Should be typed as a string
The text was updated successfully, but these errors were encountered: