TypeError in 2.9.5
See original GitHub issueI am experiencing TypeError
in apollo-server-express@2.9.5
. I’ve not had this error in previous version and I can confirm this in PR. Starting to failing the build
in circleci
when upgrading the apollo
packages.
Below is a log.
(node:5777) UnhandledPromiseRejectionWarning: TypeError: _schema.then is not a function
at new ApolloServerBase (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/apollo-server-express/node_modules/apollo-server-core/src/ApolloServer.ts:365:40)
at new ApolloServer (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/apollo-server-express/src/ApolloServer.ts:88:5)
at Object.<anonymous> (/Users/dooboolab/Github/dooboolab/hackatalk-server/src/app.ts:43:18)
at Generator.next (<anonymous>)
at /Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/merge-graphql-schemas/node_modules/apollo-link/node_modules/tslib/tslib.js:107:75
at new Promise (<anonymous>)
at __awaiter (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/merge-graphql-schemas/node_modules/apollo-link/node_modules/tslib/tslib.js:103:16)
at Object.startServer (/Users/dooboolab/Github/dooboolab/hackatalk-server/src/app.ts:27:12)
at Object.<anonymous> (/Users/dooboolab/Github/dooboolab/hackatalk-server/src/server.ts:3:1)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Module.m._compile (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/ts-node/src/index.ts:493:23)
at Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Object.require.extensions.<computed> [as .ts] (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/ts-node/src/index.ts:496:12)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at Object.<anonymous> (/Users/dooboolab/Github/dooboolab/hackatalk-server/node_modules/ts-node/src/bin.ts:158:12)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
–>
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
use react-modal error: Uncaught TypeError: Cannot read ...
Error is Uncaught TypeError: Cannot read property 'ReactCurrentOwner' of undefined. I tried reinstall node_modules, and npm install, update, ...
Read more >Frequently Asked Questions — Psycopg 2.9.5 documentation
I can't compile psycopg2 : the compiler says error: libpq-fe. h: No such file or directory. What am I missing?
Read more >“Tinymce Error!” or my screen freezes when editing ...
Currently i am using version (Version 2.9.5) i believe this is the latest version. ... kc.tools.js?ver=2.9.5:1107 TypeError: Cannot read property 'get' of ...
Read more >Icinga Web 2 Changelog
What's New in Version 2.9.5¶ ... Bug 9330: Uncaught TypeError: Cannot read property 'id' of undefined when deleting comments or downtimes via their ......
Read more >Red Hat Quay Release Notes
Version 2.9.5 ... Remove setup and superuser routes when SUPER_USERS is not enabled; TypeError in Gitlab trigger when user not found. Regressed:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perhaps there could be better type checking and error messaging. In the offending code, apollo server assumes that if it isn’t a GraphQLSchema then it is a promise of GraphQLSchema.
Potentially a fix could be to convert non-promise schemas to a promise, resolve that schema promise, then type check the schema against GraphQLSchema.
I’ve also seen other projects (e.g.
class-validator
) warn of multiple versions of the library in node_modules, although this case would be a concern for thegraphql
library.@hyochan I was also experiencing this error. I found that this issue was caused by different npm modules using conflicting versions of
graphql
. My fix included using yarn resolutions to set the version of graphql that your modules will use.Snippet from my
package.json