max
CDCloudflare Developers
•Created by max on 4/17/2025 in #workers-help
R2 seems to be ignoring the CORS policy
I have a bucket that i'm trying to upload to via signed URLs generated using aws-sdk Node package
The signed URL always fails PUT request with
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Here's my CORS policy, which should work? What am I missing?
12 replies
CDCloudflare Developers
•Created by max on 4/7/2025 in #workers-help
Worker deploys fine via Wrangler and Web UI but fails via API with SyntaxError
Hi everyone. I'm having a rather odd issue. I'm trying to deploy a worker (I'm using Workers for Platforms but it shouldn't matter) and while it's able to deploy perfectly fine using Wrangler and Web UI, when I deploy via the API, I'm getting a syntax error.
Uncaught SyntaxError: Unexpected token 'export'
It seems the API will not accept ES module syntax for some reason?
Reproduces even with Cloudflare's Hello World example:
My API code:
The multipart stuff is 100% correct and the worker uploads since the error i'm getting shows the exact location of the word export
in the code, so the issue is at the deployment stage inside Cloudflare's API
Any tips to fix it would be much appreciated!
Thanks!8 replies