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

[BUG] Cannot read properties of undefined (reading 'getFile') #120

Closed
MathiasWP opened this issue Nov 26, 2024 · 8 comments
Closed

[BUG] Cannot read properties of undefined (reading 'getFile') #120

MathiasWP opened this issue Nov 26, 2024 · 8 comments

Comments

@MathiasWP
Copy link

Describe the bug
To be honest, i am not quite sure how this has happened. Sentry captured this, and we're left wondering how this is possible. Any help would be much appreciated.

Expected behavior
This should not throw.

Screenshots
image

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows >= 10
  • Browser: Edge
  • Version: 131.0.0

Additional context
Let me know if there's anything i can do to help investigate this further.

@MathiasWP MathiasWP added the bug Something isn't working label Nov 26, 2024
@jonkoops
Copy link
Collaborator

This seems like it would be fixed by #114

@MathiasWP
Copy link
Author

This seems like it would be fixed by #114

Looks like it! Looking at the API is seems like the entry.kind === "file" would help here.

@rolandjitsu
Copy link
Collaborator

@jonkoops the same fix is in #107, though, it would reject there. Alternatively, as suggested in some of the comments there, in case the handle is undefined, we can continue to the getAsFile. I can rebase it and make it ready for master.

Following up on that conversation, the type is file at that point, so I'm also wondering why it is undefined.

@jonkoops
Copy link
Collaborator

Following up on that conversation, the type is file at that point, so I'm also wondering why it is undefined.

Indeed, it is hard to imagine a circumstance where it would be.

@MathiasWP
Copy link
Author

MathiasWP commented Nov 26, 2024

Following up on that conversation, the type is file at that point, so I'm also wondering why it is undefined.

Indeed, it is hard to imagine a circumstance where it would be.

I would imagine maybe a browser bug, since the API is still marked as experimental. I give a +1 on fallbacking to getAsFile just in case. Also not sure if e.g. browser plugins that can tinker with items in drag & drop? And therefore cause weird edge cases.

Copy link

🎉 This issue has been resolved in version 2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version 3.0.0-beta.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version 2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

3 participants