Skip to content

Error in "apollo example of this repo", and also error while using "type-graphql" #115

Description

@Iran-110

After 10 changes, saving and refreshing the page, I encountered this error:

(node:26662) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings` ... to show where the warning was created)

I also got this error in my local project.

In addition to this error, other errors also occur:

  • My project uses type-graphql.
  • At each step, by changing the content of a Resolver, the application is reset to run the server with the newer version.
  • But the previous storage of reflect-metadata (belonging to "type-graphql") is not cleared.
  • So, for example in my project after each reset the line below increments by 8 (the number of @Args and @Root of the file)
console.log("TypeGraphQL Functions' Param Decorators:", getMetadataStorage().params.length)
>> 278 (first run)
>> 286 (second run)
>> 294
>> 302
>> 310
>> 318
>> 326
>> 334
>> 342
>> 350
(node:24658) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at _addListener (node:events:593:17)
    at process.addListener (node:events:611:10)
    at file:///path-to-projct/node_modules/@apollo/server/dist/esm/ApolloServer.js:245:21
    at Array.forEach (<anonymous>)
    at ApolloServer.maybeRegisterTerminationSignalHandlers (file:///path-to-projct/node_modules/@apollo/server/dist/esm/ApolloServer.js:244:17)
    at ApolloServer._start (file:///path-to-projct/node_modules/@apollo/server/dist/esm/ApolloServer.js:191:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ApolloServer.start (file:///path-to-projct/node_modules/@apollo/server/dist/esm/ApolloServer.js:114:16)
>> 358

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions