Skip to content

2.0.0-rc.0 Typescript build error #1182

@JanPeter

Description

@JanPeter

I'm currently trying to compile a server with tsc. While the whole projects works fine when I run it with ts-node or ts-jest it won't compile with tsc.

I get the following errors:

$ tsc
node_modules/apollo-server-express/dist/ApolloServer.d.ts:1:8 - error TS1192: Module '"node_modules/@types/express/index"' has no default export.

1 import express from 'express';
         ~~~~~~~


node_modules/apollo-server/dist/index.d.ts:2:8 - error TS1192: Module '"http"' has no default export.

2 import http from 'http';
         ~~~~

Here is a shortened version of my package.json file:

  "scripts": {
    "build": "tsc",
    ...
  },
  "dependencies": {
    "apollo-server": "^2.0.0-rc.0",
    "apollo-server-express": "^2.0.0-rc.0",
    ...
  },
  "devDependencies": {
    "@types/express": "^4.16.0",
    "@types/jest": "^22.2.3",
    "@types/node": "^10.3.3",
    "jest": "^22.4.3",
    "jest-cli": "^22.4.3",
    "ts-jest": "^22.4.6",
    "ts-node": "^6.0.3",
    "typescript": "^2.9.2",
    ...
  },

If I'm correct this is a bug and I could submit a pull request. I think that both of the imports needs to be replaced with a import * as express from "express" and import * as http from "http". The first import is correct in the master branch and the second file doesn't exist in the master branch. Am I missing something or is this really wrong?

Also Typescript doesn't complain about the import express from "express" in the Apollo-Server/index.ts file, although it should be also wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions