Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Cloudflare ESModule server cannot be published to Cloudflare. #1231

Closed
sirganya opened this issue May 24, 2022 · 8 comments
Closed

Comments

@sirganya
Copy link

Describe the bug

The example script in Cloudflare-module gives an error when published using wrangler v2.06

The uploaded script has no registered event handlers. [code: 10068]

Your Example Website or App

https://github.com/dotansimha/graphql-yoga/tree/master/examples/cloudflare-modules

Steps to Reproduce the Bug or Issue

Clone your repo, install packages and attempt to publish with wrangler

Expected behavior

I expect the sample application to publish successfully to a Cloudflare worker.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • NodeJS: 18.1.0
  • @graphql-yoga/* version(s): [e.g. 2.6.1]
  • "wrangler": "2.0.6"

Additional context

No response

@ardatan
Copy link
Collaborator

ardatan commented May 24, 2022

Make sure you have configured your project to use modules. You can check Cloudflare docs for more details because it seems you haven't since it asks you to have fetch event listener just like our regular Cloudflare example that uses server.start() instead of exporting the server.

@n1ru4l
Copy link
Collaborator

n1ru4l commented May 25, 2022

@ardatan Seems like we should update the documentation to be more precise: https://www.graphql-yoga.com/docs/integrations/integration-with-cloudflare-workers

@sirganya
Copy link
Author

Make sure you have configured your project to use modules. You can check Cloudflare docs for more details because it seems you haven't since it asks you to have fetch event listener just like our regular Cloudflare example that uses server.start() instead of exporting the server.

It's your project.

@n1ru4l
Copy link
Collaborator

n1ru4l commented May 25, 2022

We should add an e2e test similar to https://github.com/dotansimha/graphql-yoga/blob/master/e2e/tests/cf-worker.ts for the cloudflare-modules example.

@ardatan
Copy link
Collaborator

ardatan commented May 25, 2022

It's your project.

Could you try to update your wrangler configuration like below and try again? (I just updated the configuration)
https://github.com/dotansimha/graphql-yoga/blob/master/examples/cloudflare-modules/wrangler.toml

@sirganya
Copy link
Author

Have you published this version using wrangler successfully? I had a similar config yesterday day when I was attempting to get the example working.

@ardatan
Copy link
Collaborator

ardatan commented Jun 6, 2022

Could you try to deploy the example now? We have just updated the example.

@n1ru4l
Copy link
Collaborator

n1ru4l commented Jun 8, 2022

@ardatan can we make sure all the Cloudflare variant examples are end2end tested in order to prevent future regressions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants