All,
I’m having trouble uploading my Workers script via the CF Workers API. When pasting the same script into the sandbox, it works fine. No go here, though.
curl -s -X PUT \
-H "X-Auth-Email: EMAIL_REMOVED" \
-H "X-Auth-Key: AUTH_KEY_REMOVED" \
-H "Content-Type: application/javascript" \
--data-binary "build/script.js" \
-o "/tmp/deploy.sh.ejcLYT/output_script.js.7TVhf3" \
"https://api.cloudflare.com/client/v4/zones/ZONE_ID_REMOVED/workers/script"
Which returns:
{
"result": null,
"success": false,
"errors": [
{
"code": 10021,
"message": "Uncaught ReferenceError: build is not defined\n at line 1\n"
}
],
"messages": []
}
Any idea what I’m doing wrong?
Thanks,
Jason.