Error createObjectURL
while proxy a file
#959
Unanswered
Laxy317
asked this question in
Bug report
Replies: 2 comments
-
ObjectURL seems like a non-proxifyable object. You need to mark it a ref: - preUploadFileProxy.files['test'] = file
+ preUploadFileProxy.files['test'] = ref(file) |
Beta Was this translation helpful? Give feedback.
0 replies
-
To expand a bit, URL.createObjectURL is looking specifically for a Blob, File, or a MediaSource. As Dai-shi said, it won't take a proxy. What you can do as an alternative is store the metadata for the file in the proxy and then use a WeakMap with the proxy object as the key to store the file. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug Description
I can't use ‘createObjectURL’ on a proxied file.
Reproduction Link
https://codesandbox.io/p/sandbox/valtio-to-do-list-forked-z7f97m?from-embed=&workspaceId=390a0bb3-79cb-476b-a0c1-12eaeae7ba71
Beta Was this translation helpful? Give feedback.
All reactions