cloudflare / cloudflare/workers-webpack-example

Error uploading script to cloudflare

Open
#1 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
33
Forks
9
PR merge metrics
No merged PRs in 30d

Description

So I followed the example and when I try to upload the compiled `bundle.js` to cloudflare, I get the following error:

```bash
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/workers/script" \
-H "X-Auth-Email:${CLOUDFLARE_API_EMAIL}" -H "X-Auth-Key:${CLOUDFLARE_API_KEY}" \
-H "Content-Type:application/javascript" --data-binary "@dist/bundle.js"
```

```json
{
"result": null,
"success": false,
"errors": [
{
"code": 10021,
"message": "Uncaught EvalError: Code generation from strings disallowed for this context\n at line 96 in ./src/index.ts\n at line 20 in __webpack_require__\n at line 84\n at line 87\n"
}
],
"messages": []
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.