Skip to content

TypeError: (0 , utils_1.promiseReduce)(...).resolve is not a function #7052

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

Open
4 tasks
inpercima opened this issue Mar 21, 2025 · 4 comments
Open
4 tasks

Comments

@inpercima
Copy link

inpercima commented Mar 21, 2025

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

Since updating from graphql-tools/utils version 10.8.1 to 10.8.6, I have noticed the above-mentioned error with mutations.
It turned out that a downgrade to 10.8.2 works. All versions above this throw the error.

stacktrace: Array(11) [ "TypeError: (0 , utils_1.promiseReduce)(...).resolve is not a function", " 
 at executeFieldsSerially (/workspace/application/backend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/executor/cjs/execution/execute.js:257:29)", "
 at executeOperation (/workspace/application/backend/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/executor/cjs/execution/execute.js:231:18)", … ]

So it could be a change in version 10.8.3 causes this error.

Environment:

  • OS: Linux/Ubuntu
"@graphql-tools/delegate": "10.2.14",
"@graphql-tools/stitch": "9.4.19",
"@graphql-tools/utils": "10.8.2",
"@graphql-tools/wrap": "10.0.32",
"graphql": "16.10.0",
  • NodeJS: 22.14.0
@ardatan
Copy link
Owner

ardatan commented Mar 21, 2025

Please share a minimal isolated reproduction on CodeSandbox. Thanks!

@ikemo3
Copy link

ikemo3 commented Mar 23, 2025

I encountered a similar error:

ERR TypeError: promiseReduce(...).resolve is not a function
    at executeFieldsSerially (file:///usr/src/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/executor/esm/execution/execute.js:261:29)
    at executeOperation (file:///usr/src/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@graphql-tools/executor/esm/execution/execute.js:235:18)

Pinning "@whatwg-node/promise-helpers" to version "1.2.4" fixed the issue for me.
I don't know the root cause, but I hope this information helps.

@inpercima
Copy link
Author

inpercima commented Mar 23, 2025

Thank you @ikemo3 for your response.

Yesterday I created a test repository for the issue but I could not reproduce the problem. I took all configurations and also the graphql codes from the original project, but it worked. After a few considerations I checked the pnpm lock file from the original project and realized that it works with a complete installation of the dependencies. But I had no idea why, the changes were to much to find the reason.

Now with your answer I can confirm, pinning @whatwg-node/promise-helpers to version 1.2.4 fixes the issue too.
So both worked for me.

@acburdine
Copy link

acburdine commented Apr 3, 2025

I ran into this issue as well today.

As has been mentioned before, pinning promise-helpers to 1.2.4 does fix the issue (I also tried 1.2.5 and it worked as well) but I also realized that I was running an older version of @graphql-tools/executor. Bumping @graphql-tools/executor to the latest (1.4.7 as of this morning, but I believe 1.4.2 is the fixed version) fixed the issue.

What I suspect is that the changes in this PR: ardatan/whatwg-node#2152 don't play nicely with the code in @graphql-tools/executor prior to the changes made to the executor package in this pr: #6971.

Would have to do some more spelunking through my dependency graph to verify, but I think the issue could be resolved by updating a caret range in one/more of the graphql-tools repos 🤔 (for me @graphql-tools/executor is being pulled in as a dep of graphql-yoga)

TL;DR @whatwg-node/promise-helpers >= v1.3.0 plus @graphql-tools/executor <= v1.4.1 causes the bug.

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

4 participants