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

Build fails: "TypeError: autoGeneratedSchema.toConfig is not a function" #349

Closed
KristenLeach opened this issue Jul 23, 2019 · 6 comments
Closed

Comments

@KristenLeach
Copy link

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

After running an npm audit and updating nestjs/graphql, I am met with this error: (node:36595) UnhandledPromiseRejectionWarning: TypeError: autoGeneratedSchema.toConfig is not a function at GraphQLFactory.<anonymous>

nestjs/common and core were both updated as well, and the issue persists. I updated version numbers manually after seeing this error to isolate the issue, and it seems to be coming from something within nestjs/graphql.

Expected behavior

App builds successfully

Minimal reproduction of the problem with instructions

updated from

    "@nestjs/common": "6.0.1",
    "@nestjs/core": "6.0.1",
    "@nestjs/graphql": "6.0.1",

to

    "@nestjs/common": "6.5.3",
    "@nestjs/core": "6.5.3",
    "@nestjs/graphql": "6.4.2",

What is the motivation / use case for changing the behavior?

For whatever reason, autoGeneratedSchema.toConfig() is throwing a TypeError claiming that toConfig() is not a function. Because of this, the build fails.

Environment


Nest version: 5.7.1
 
For Tooling issues:
- Node version: 10.15.0
- Platform:  Mac

Others:
MacOS Mojave v 10.14.5
Visual Studio Code
@kamilmysliwiec
Copy link
Member

Could you please provide a minimal repository which reproduces your issue? I'll take a look

@KristenLeach
Copy link
Author

Working on this between my regular job hours. 😬 With a minimal repo with very little data to add to the schema, the error does not happen. Somewhere in my massive work repo during the schema build the error is getting thrown with the updated packages. I will keep digging to see if I can isolate where it is coming from. I traced it back to where .toConfig is being called from graphql, but what is causing the error is still tbd.

@kamilmysliwiec
Copy link
Member

Got it. Let me know if you find something :)

@kamilmysliwiec
Copy link
Member

I'll close it temporarily. If you face this issue again, please, ping me.

@KristenLeach
Copy link
Author

Ooh!!!! Found it. Not Nest; graphql. For some reason my graphql package never updated nor was I prompted showing it as a dependency to update it manually. But I found someone else had a similar issue; apparently the .toConfig() function was added in 14.3.1, so I updated graphql to that version and it is resolved. Phew!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants