Closed vmurin closed 2 months ago
Hi @vmurin Thank you for opening up this issue. I'm unable to reproduce this issue from quick testing, and I was actually seeing it use the fetch
API under the hood. The repo you shared seems to be a provided repo, can you grant me access to it?
Hi @HuiSF, I sent you an invitation to the repo
Hey @vmurin Thanks for provide the sample code and detailed instruction. I was able to reproduce the same error testing with the API route /fetch-prices
. Noticeably you specified to use EdgeRuntime on this route, that may actually specified the bundle built for this API Route runs as a "browser" bundle. In the storage package, we are rerouting to use XHR instead of fetch on purpose to support better upload progress tracking.
Next.js is building bundle for EdgeRuntime with browser
, details see: https://github.com/vercel/next.js/discussions/41235 Hence, we have not listed any Storage API as supported server-side API on Next.js EdgeRuntime. See this documentation for details.
Hey @HuiSF Thank you very much for your analysis. Exactly - that was the case - on one route the code was running as intended and on on the /fetch-price
the error was thrown. And I was wondering what makes the difference!
No, EdgeRuntime was just an experiment and has no any background. :)
You are absolutely right - the storage API ist not supported on the Edge... I was not realizing that I have it activated :)
No worries @vmurin glad that this helps. Please let us know if anything else we can assist
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Storage
Amplify Version
v6
Amplify Categories
storage
Backend
Amplify Gen 2 (Preview)
Environment information
Describe the bug
If using the option
validateObjectExistence
in server functiongetUrl
following error is thrown:Unfortunately error is thrown not on every call See complete code snippet below
Expected behavior
server version of the getUrl do NOT use XMLHttpRequest (see stack trace below) and returns the URL of the S3 object
Reproduction steps
The code snippet is from the following repo: https://github.com/vmurin/crypto-portfolio
File: https://github.com/vmurin/crypto-portfolio/blob/master/app/utils/utils.ts
cryptoData.json
from READMECode Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response