You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apollo-server-cloudflare overrides the handy listen() method to set up addEventListener('fetch', …) but wrangler publish doesn't like this and fails with
Error: Something went wrong! Status: 400 Bad Request, Details {
"result": null,
"success": false,
"errors": [
{
"code": 10021,
"message": "No event handlers were registered. This script does nothing.\n"
}
],
"messages": []
}
I guess wrangler always requires a top-level addEventListener that is not registered in an async function.
I was able to fix this by implementing my own top-level event handler and copying the code from listen()
As of Apollo Server 4, we maintain a stable API for building web framework integrations instead of a specific integration with CloudFlare Workers (which, let's be honest, was an experimental integration that one person wrote over the weekend 4.5 years ago and we never touched again — it's impressive that it worked as well as it did for anyone!). We hope to see CloudFlare Workers users build and maintain an integration against our new API!
apollo-server-cloudflare
overrides the handylisten()
method to set upaddEventListener('fetch', …)
butwrangler publish
doesn't like this and fails withI guess wrangler always requires a top-level addEventListener that is not registered in an async function.
I was able to fix this by implementing my own top-level event handler and copying the code from
listen()
Example
https://github.com/maggo/apollo-cloudflare-issue
Clone, yarn, add account_id in
wrangler.toml
andwrangler publish
. You'll receive the same errorThe text was updated successfully, but these errors were encountered: