Error: file is missing, Promise has not been resolved (sometimes)
See original GitHub issueHello,
Since upgrading from 8.0.2 to 11.0.0 (node 14), when uploading a file from iOS (tested on Safari, Chrome) or MacOS (tested on Safari, Chrome DOESN’T HAVE the bug), the file is sometimes missing as the Promise has not been resolved with its content.
I have now tested around 100 times on Chrome MacOS (100 worked), and around 100 times on Safari MacOS, Chrome iOS and Safari iOS (around 40 worked). When it did not work, the file is missing and only the promise
and resolve
keys are here.
I would gladly help you fix it if I can, would you have any idea where it may come from?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
I'm just not getting ES6 "promises" - Stack Overflow
I was missing: 1) use of "spread()" vs. ".then()", 2) using "resolve" to pass results from one "thenable" function to the next (eliminating...
Read more >Error handling with promises
Error handling with promises. Asynchronous actions may sometimes fail: in case of an error the corresponding promise becomes rejected.
Read more >5 Easy Ways to Fix the "jQuery is Not Defined" Error - Kinsta
The "jQuery is not defined" error means a call for a specific jQuery that wasn't available when the website loaded. Here's how to...
Read more >How to fix "The following module is missing from the file ...
Usually this indicates a problem with your site. It is not a major problem, but one which should ideally be fixed if possible....
Read more >Get help with Windows activation errors - Microsoft Support
This article will help you troubleshoot and fix common activation errors in ... If the device is new and has never been activated,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello, I’m one of the back-end developper that worked on the topic. We are currently using the version 11.0.0. We were using the syntax you suggest on node 12.xx, but since upgrading to node 14, we had to bump the version of
graphql-upload
as a dependency ofapollo-server
(as per this comment, so we upgraded to version 11.0.0, and the syntax you propose don’t work anymore for us. The object we have is a direct Upload object, instead of FileUpload, and has this shape:{resolve: ƒ, reject: ƒ, promise: Promise, file: {…}}
, with file being a FileUpload object. So we had to access the underlying file property in order to have access to{ filename, mimetype, createReadStream }
. This worked in most of the cases, but we had to also await the underlying promise in order to be sure our file property is populated. Seems like if there was a step bypassed in the object construction in order to have a proper FileUpload object in the end. In the end, finally found the source of the issue, but can still be interesting for further investigation : After multiple tests, it appears this syntax works fine withgraphql-upload
version 9.0.0 but with version 11.0.0 there is an issue with the wayapollo-server
handles the upload, and we have access to a primitive Upload object instead of the final FileUpload one.Hey, sorry about the delay. It seems doing
await image.promise
does the trick and generatesimage.file
(note:await file
doesn’t work).About your questions: I’m integrating a back-end which is using graphql-upload and don’t have all the info, but it seemed like the promise didn’t resolve (again, on the browsers which I mentioned, and not everytime - testing 10 times would guarantee I got the error at least once though).
I don’t have any idea about the busboy issue, sorry.
Please let me know if I can provide more info, or if this is just intended behavior.