-
Notifications
You must be signed in to change notification settings - Fork 348
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
Error The script will never generate a response
on Cloudflare Worker when using mesh
#5112
Comments
I'd assume this is https://zuplo.com/blog/the-script-will-never-generate-a-response-on-cloudflare-workers/ I haven't yet sorted what hoops to jump through to avoid this. Seems really hard to write e.g. in-memory caching with this limitation. |
We found that the node compatibility was causing this, once we removed it we haven't seen any errors. We moved to using plugins instead of transforms in the yaml file for our mesh gateway, so we didn't need the node compatibility anymore! |
Awesome! So we can close this issue then! |
Yes this is solved for us, thanks :) |
Do you think we should mention that in our docs? |
That would be great. |
Would you contribute to our docs with a PR because I think the words from your perspective would be better :) |
yeah sure :) which doc\file should I add this too? |
###
Issue workflow progressProgress of the issue based on the
Contributor Workflow
Github,
Stackblitz
or
CodeSandbox
Describe the bug
We have a POC of a graphql gateway using the mesh library on a Cloudflare worker.
When running performance testing we notices a lot of these errors:
The script will never generate a response
.On research of this error we think this is due to
meshInstance$
being a global variable and several requests trying to access it at the same time, and they fail with a failed Promise error. I see this error in the console log:A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.
Our worker code is very simple, this is the index.ts:
with a few online API graphql endpoints in our yaml file
To Reproduce Steps to reproduce the behavior:
Create a new mesh gateway and with that index.ts and load to a Cloudflare worker using wrangler.
Expected behavior
Being able to run a load test without having these unresolved Promise errors
Environment:
"wrangler": "2.8.0",
"@graphql-mesh/cli": "^0.82.10",
"@graphql-mesh/graphql": "^0.33.8",
"@graphql-mesh/runtime": "^0.46.5",
"@graphql-mesh/transform-resolvers-composition": "^0.13.5",
"graphql": "^16.6.0",
"http-status-codes": "^2.2.0",
"envelop": "^1.4.0"
@graphql-mesh/...
:v18.13.0
Additional context
This is very similar to this issue but no solution was offered
The text was updated successfully, but these errors were encountered: