nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.73k stars 7.63k forks source link

[TS] Apollo CacheControl duplicate declaration #4293

Closed numToStr closed 4 years ago

numToStr commented 4 years ago

Bug Report

Previously my project was working fine. Today updated the dependencies after that I got this issue:

node_modules/@apollo/gateway/node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'cacheControl' must be of type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }', but here has type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }'.

                        cacheControl: {
                        ~~~~~~~~~~~~

    mnode_modules/apollo-cache-control/dist/index.d.ts:24:9
                                cacheControl: {
                                ~~~~~~~~~~~~
    'cacheControl' was also declared here.

6:29:58 PM - Found 1 error. Watching for file changes.

I tried deleting node_modules but got the same issue.

Current behavior

Unable to start the server.

Environment

package.json

{
    "name": "nest-app",
    "version": "0.0.1",
    "description": "",
    "author": "numtostr <vikas.raj1911@gmail.com>",
    "license": "MIT",
    "scripts": {
        "prebuild": "rimraf dist",
        "build": "nest build",
        "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
        "start": "nest start",
        "dev": "NODE_ENV=development yarn prebuild && nest start --watch",
        "start:debug": "nest start --debug --watch",
        "start:prod": "NODE_ENV=production node dist/src/main",
        "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
        "test": "jest",
        "test:watch": "jest --watch",
        "test:cov": "jest --coverage",
        "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
        "test:e2e": "jest --config ./test/jest-e2e.json"
    },
    "dependencies": {
        "@nestjs/common": "^6.11.11",
        "@nestjs/config": "^0.3.0",
        "@nestjs/core": "^6.11.11",
        "@nestjs/graphql": "^6.6.2",
        "@nestjs/platform-fastify": "^6.11.11",
        "apollo-server-fastify": "^2.11.0",
        "graphql": "^14.6.0",
        "graphql-tools": "^4.0.7",
        "reflect-metadata": "^0.1.13",
        "rimraf": "^3.0.2",
        "rxjs": "^6.5.4",
        "type-graphql": "^0.18.0-beta.11"
    },
    "devDependencies": {
        "@nestjs/cli": "^6.13.2",
        "@nestjs/schematics": "^6.8.1",
        "@nestjs/testing": "^6.11.11",
        "@types/express": "^4.17.3",
        "@types/jest": "25.1.4",
        "@types/node": "^13.9.1",
        "@types/supertest": "^2.0.8",
        "@typescript-eslint/eslint-plugin": "^2.23.0",
        "@typescript-eslint/parser": "^2.23.0",
        "eslint": "^6.7.2",
        "eslint-config-prettier": "^6.7.0",
        "eslint-plugin-import": "^2.19.1",
        "jest": "^25.1.0",
        "prettier": "^1.18.2",
        "supertest": "^4.0.2",
        "ts-jest": "25.2.1",
        "ts-loader": "^6.2.1",
        "ts-node": "^8.6.0",
        "tsconfig-paths": "^3.9.0",
        "typescript": "^3.8.3"
    },
    "jest": {
        "moduleFileExtensions": [
            "js",
            "json",
            "ts"
        ],
        "rootDir": "src",
        "testRegex": ".spec.ts$",
        "transform": {
            "^.+\\.(t|j)s$": "ts-jest"
        },
        "coverageDirectory": "../coverage",
        "testEnvironment": "node"
    }
}
kamilmysliwiec commented 4 years ago

This doesn't seem to be related to NestJS. Please, report this issue in the apollo-cache-control repo