question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple TypeScript linting errors in apollo-server-express > 2.10.1

See original GitHub issue

After upgrading apollo-server-express from v2.10.0 to v2.12.2, I get the following error in running tslint:

node_modules/apollo-server-express/node_modules/@types/express/index.d.ts:103:54 - error TS2315: Type 'Response' is not generic.

103     export interface Response<ResBody = any> extends core.Response<ResBody> { }

I noted that while the apollo-server-express/package.json specifies @types/express@4.17.4, the actual version installed installed by npm@6.13.6 in node_modules/apollo-server-express/package.json specifies @types/express@4.17.3:

{
  "_from": "apollo-server-express@latest",
  "_id": "apollo-server-express@2.12.0",
  "_inBundle": false,
  "_integrity": "sha512-oTBKM2SsziCoFW+ta+ubJ/ypvsc+EWrbJnyZhJ5FBYzSXPstt/jvgZHgMO+kOQgHEHrbJwugNDUuLMSm608L7A==",
  "_location": "/apollo-server-express",
  "_phantomChildren": {
    "@types/connect": "3.4.32",
    "@types/express-serve-static-core": "4.16.10",
    "@types/node": "13.11.1",
    "@types/serve-static": "1.13.3"
  },
  "_requested": {
    "type": "tag",
    "registry": true,
    "raw": "apollo-server-express@latest",
    "name": "apollo-server-express",
    "escapedName": "apollo-server-express",
    "rawSpec": "latest",
    "saveSpec": null,
    "fetchSpec": "latest"
  },
  "_requiredBy": [
    "#USER",
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.12.0.tgz",
  "_shasum": "a03cef8a3aa753bff73156e6a31fd59a076dc48b",
  "_spec": "apollo-server-express@latest",
  "_where": "/Users/keith.gillette/Code/TaskTrain",
  "author": {
    "name": "opensource@apollographql.com"
  },
  "bugs": {
    "url": "https://github.com/apollographql/apollo-server/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "@apollographql/graphql-playground-html": "1.6.24",
    "@types/accepts": "^1.3.5",
    "@types/body-parser": "1.19.0",
    "@types/cors": "^2.8.4",
    "@types/express": "4.17.3",
    "accepts": "^1.3.5",
    "apollo-server-core": "^2.12.0",
    "apollo-server-types": "^0.3.1",
    "body-parser": "^1.18.3",
    "cors": "^2.8.4",
    "express": "^4.17.1",
    "graphql-subscriptions": "^1.0.0",
    "graphql-tools": "^4.0.0",
    "parseurl": "^1.3.2",
    "subscriptions-transport-ws": "^0.9.16",
    "type-is": "^1.6.16"
  },
  "deprecated": false,
  "description": "Production-ready Node.js GraphQL server for Express and Connect",
  "devDependencies": {
    "apollo-server-integration-testsuite": "^2.12.0"
  },
  "engines": {
    "node": ">=6"
  },
  "gitHead": "71a3863f59f4ab2c9052c316479d94c6708c4309",
  "homepage": "https://github.com/apollographql/apollo-server#readme",
  "keywords": [
    "GraphQL",
    "Apollo",
    "Server",
    "Express",
    "Connect",
    "Javascript"
  ],
  "license": "MIT",
  "main": "dist/index.js",
  "name": "apollo-server-express",
  "peerDependencies": {
    "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-express"
  },
  "types": "dist/index.d.ts",
  "version": "2.12.0"
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:7

github_iconTop GitHub Comments

1reaction
Tetriandocommented, Sep 23, 2020

@KeithGillette Seems to be working now properly with latest v2.18.0 version. At least for me.

0reactions
KeithGillettecommented, Sep 23, 2020

Thanks for the heads-up @Tetriando. I just updated and confirm that apollo-server-express@2.18.0 lints without error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm - TypeScript import issues in apollo-server-express ...
The import type syntax used in apollo-server-core isn't supported by the version of typescript that you're using (v3.6).
Read more >
Error handling - Apollo GraphQL Docs
This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e., operationName ), or if the named operation...
Read more >
Attribution Report - Skillsoft Product Documentation
# Library Licenses 1 1to2‑1.0.0.tgz MIT 2 JSONStream‑0.8.4.tgz Apache 2.0. MIT 3 JSONStream‑1.3.5.tgz Apache 2.0. MIT
Read more >
Collibra Platform OSS Attribution File.txt
... or (iii) discover any errors or omissions in the licensing information ... GPL-3.0-with-GCC-exception] - Apache Hadoop Client Aggregator (2.10.1) ...
Read more >
Common React TypeScript ESLint / Lint Errors & Warning ...
In the past, I worked at a well-known company (that I would not disclose the name) that had a technology debt of over...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found