No event handlers were registered. This script does nothing. [code: 10021]
Processing src/wrangler.json configuration:
- Unexpected fields found in top-level field: "crons"
Total Upload: 0.69 KiB / gzip: 0.40 KiB
Your worker has access to the following bindings:
- KV Namespaces:
- MY_KV: ----
✘ [ERROR] A request to the Cloudflare API (/accounts/----/workers/scripts/my-worker) failed.
No event handlers were registered. This script does nothing.
[code: 10021]. .... any one how to solve this
13 Replies
Are you doing
,
"crons": [
"*/15 * * * *",
"0 0 * * *",
"0 0 * * MON"
],
something this
Yeah, it needs to be listed under
triggers
thanks
hey still having same. error
npx wrangler deploy src/wrangler.json
⛅️ wrangler 3.107.3
--------------------
Total Upload: 0.68 KiB / gzip: 0.40 KiB
Your worker has access to the following bindings:
- KV Namespaces:
- MY_KV: ---
✘ [ERROR] A request to the Cloudflare API (/accounts/---/workers/scripts/my-worker) failed.
No event handlers were registered. This script does nothing.
[code: 10021]
What does the
main
file of your Worker look like?
I meant, what does
app.js
look like? Also, note that the contents of your wrangler.json
is safe to be shared(as long as you aren't putting secrets in it). Binding IDs are tied to your account, so unless a user has access to your account, they won't be able to use them for anythinglike this
"wrangler.json is safe to be shared" thanks for letting know.
Oh, that's it. You can't use
express
on Workersokay
any thing else
i do for it
can i use pages
to deploy this project
Cloudflare Pages is for static content (HTML, CSS, JS, images and other such files). It will not run a webserver such as Express, Koa or the likes. If you're using those to serve static content then you can just remove that part and use Pages!
If you're doing more dynamic content you can use Functions. It will run code on request (so still not a webserver in the conventional sense). This would allow for more dynamic content though especially with KV (Key/Value storage) and Durable Objects (transactional data storage). Functions are natively integrated with Pages so are super easy to get up and running along your website.
Otherwise, a good old VPS or dedicated server from one of the many hosts out there is for you.