WhatsApp-Clone-Server icon indicating copy to clipboard operation
WhatsApp-Clone-Server copied to clipboard

running master error -> installSubscriptionHandlers

Open idkjs opened this issue 5 years ago • 4 comments

After cloning and installing the server, then running yarn start you get an error saying

Property 'installSubscriptionHandlers' does not exist on type 'ApolloServer'.

~/Downloads/WhatsMaster/WhatsApp-Clone-Server master*
❯ yarn start
yarn run v1.22.4
$ yarn codegen
$ graphql-codegen
  ✔ Parse configuration
  ✔ Generate outputs
$ ts-node index.ts

/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:434
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
index.ts:13:8 - error TS2339: Property 'installSubscriptionHandlers' does not exist on type 'ApolloServer'.

13 server.installSubscriptionHandlers(httpServer);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    at createTSError (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:434:12)
    at reportTSError (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:438:19)
    at getOutput (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:578:36)
    at Object.compile (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:775:32)
    at Module.m._compile (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:858:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/mandalarian/Downloads/WhatsMaster/WhatsApp-Clone-Server/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:861:12)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Is there a working branch or a way to resolve this error that you are aware of?

Thank you.

idkjs avatar Jun 11 '20 15:06 idkjs

Hi @idkjs ! Which version of apollo-server do you have installed?

dotansimha avatar Jun 11 '20 15:06 dotansimha

@Urigo can you take a look? maybe something has changed in apollo-server?

dotansimha avatar Jun 11 '20 15:06 dotansimha

using the version in package.json, 2.13.1

idkjs avatar Jun 11 '20 15:06 idkjs

i'm following a tutorial and had this issue, but its version was at 2.19.0 for apollo-server-express which appears to be a separate npm module from Apollo-server. Once i installed the apollo-server-express plugin at the version 2.19.0 the issue went away, hope this helps.

bastianhilton avatar Nov 20 '22 08:11 bastianhilton