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

TS2345: Argument of type 'IFile' is not assignable to parameter of type 'string | Blob'. #144

Open
joegasewicz opened this issue Jun 7, 2021 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@joegasewicz
Copy link
Owner

joegasewicz commented Jun 7, 2021

Error:

TS2345: Argument of type 'IFile' is not assignable to parameter of type 'string | Blob'.

Recreate error:

const teacher_img = getFileFromRef(teacherImgRef);
formData.append("teacher_img", teacher_img); // Error thrown here -> TS2345: Argument of type 'IFile' is not assignable to parameter of type 'string | Blob'.

Quick fix:

formData.append("teacher_img", teacher_img as any);
@joegasewicz joegasewicz added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant