Module import path resolution error in apollo server v4

27 views Asked by At

I'm getting Cannot find module error in apollo graphql v4 server.

Apollo graphql server recommends this typescript configuration :

{
  "compilerOptions": {
    "rootDirs": ["src"],
    "outDir": "dist",
    "lib": ["es2020"],
    "target": "es2020",
    "module": "esnext",
    "moduleResolution": "node",
    "esModuleInterop": true,
    "types": ["node"]
  }
}

so that we can use top-level await without async but now I am getting error messages after importing Apollo Server into a Typescript-based Node.js application

enter image description here

I tried to change typescript configurations but one setting was connected to other, i.e: if I set module to commonjs then target cant be es2020

0

There are 0 answers