privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js

Home Page:https://tsx.is

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@apollo/server can't load

jwanglof opened this issue · comments

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I am reporting a confirmed bug (not seek debugging help)
  • I understand this is a collaborative project and relies on my contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/jwanglof/tsx-reproduction

Problem & expected behavior (under 200 words)

Skip this section and let your reproduction do the talking...

But if you really need to explain, keep it under 200 words:

  • What happened
  • What I expected
  • Error stack trace
  • Documentation links
  • Screenshots

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support

@privatenumber Can this be reopened? We are running into this as well. No issues with 4.11.2, but 4.12.0 to 4.15.6 all fail.

The issue seems to stem from the @josephg/resolvable package, which creates the following stack trace:

/app/node_modules/.pnpm/@apollo+server@4.10.4_graphql@16.8.2/node_modules/@apollo/server/dist/esm/ApolloServer.js:127
        const barrier = resolvable();
                        ^

TypeError: resolvable is not a function
    at ApolloServer._start (/app/node_modules/.pnpm/@apollo+server@4.10.4_graphql@16.8.2/node_modules/@apollo/server/dist/esm/ApolloServer.js:127:25)
    at ApolloServer.start (/app/node_modules/.pnpm/@apollo+server@4.10.4_graphql@16.8.2/node_modules/@apollo/server/dist/esm/ApolloServer.js:115:27)
    at startApolloServer (/app/src/graphql/server.ts:143:22)
    at Server.<anonymous> (/app/src/server.ts:105:13)
    at Object.onceWrapper (node:events:632:28)
    at Server.emit (node:events:530:35)
    at emitListeningNT (node:net:1931:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

In ApolloServer.ts:

import resolvable, { type Resolvable } from '@josephg/resolvable';
...
const barrier = resolvable();

You can file a new issue with a minimal reproduction.

The reproduction provided by OP has many irrelevant dependencies and files. Effort counts a lot here.