Apollo-server: TypeError on build.

Created on 21 Aug 2018  路  12Comments  路  Source: apollographql/apollo-server

Getting type issue when running build, any ideas?

node_modules/apollo-server-core/dist/playground.d.ts(4,27): error TS1005: ';' expected.
node_modules/apollo-server-core/dist/playground.d.ts(4,42): error TS1005: ')' expected.
node_modules/apollo-server-core/dist/playground.d.ts(4,43): error TS1005: ';' expected.
node_modules/apollo-server-core/dist/playground.d.ts(4,78): error TS1005: ';' expected.
node_modules/apollo-server-core/dist/playground.d.ts(4,118): error TS1005: '(' expected.
node_modules/apollo-server-core/dist/playground.d.ts(4,124): error TS1005: ')' expected.
node_modules/apollo-server-core/dist/playground.d.ts(5,1): error TS1128: Declaration or statement expected.

馃К typings

Most helpful comment

same issue with typescript 3.0.3 and apollo-server 2.1.0 :(

All 12 comments

Any had the same experience?

@RadAcademy did you find a solution to this? just updated to 2.0.5 and am seeing the same issue.

Jazmin,

I believe updating my package.json to typescript 2.9.2 solved this.

here are all my versions to compare:

"dependencies": {
"@angular/animations": "^6.1.6",
"@angular/common": "^6.1.4",
"@angular/compiler": "^6.1.6",
"@angular/core": "^6.1.6",
"@angular/forms": "^6.1.6",
"@angular/http": "^6.1.6",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.6",
"apollo-angular": "^1.3.0",
"apollo-angular-link-http": "^1.2.0",
"apollo-cache-inmemory": "^1.2.9",
"apollo-client": "^2.4.1",
"apollo-link": "^1.2.2",
"apollo-link-context": "^1.0.8",
"aws-sdk": "^2.306.0",
"core-js": "^2.5.7",
"graphql": "^0.13.2",
"graphql-tag": "^2.9.2",
"lodash": "^4.17.10",
"rxjs": "^6.3.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.5",
"@angular/cli": "~6.1.5",
"@angular/compiler-cli": "^6.1.6",
"@angular/language-service": "^6.1.6",
"@types/graphql": "^0.13.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.9.4",
"codelyzer": "~4.4.4",
"concurrently": "^4.0.1",
"copyfiles": "^2.0.0",
"graphql-code-generator": "^0.11.0",
"graphql-codegen-apollo-angular-template": "^0.11.0",
"graphql-tools": "^3.1.1",
"jasmine-core": "~3.2.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.2",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^1.3.1",
"onchange": "^4.1.0",
"pack-zip": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.1",
"tslint": "~5.11.0",
"typescript": "^2.9.2"
}

same issue with typescript 3.0.3 and apollo-server 2.1.0 :(

Works for me on typescript 3.0.3 and apollo-server-express 2.1.0

I am also seeing this on typescript 3.1.6 and apollo-server 2.2.2.

Just filed this related issue, I'm using apollo-server-express 2.2.2 and typescript 2.8.3

Got it to work by upgrading to typescript 3.1.6

I was able to fix this by changing my ApolloServer import statement. I was using the es6 syntax of import { ApolloServer } from "apollo-server". After switching to the require format, the error went away
const ApolloServer = require("apollo-server");

@cmcaboy I think that doing that you're just bypassing TS validations when using imports, not really solving the problem. From my understanding, if there's an issue with that import, it will show up in execution time, rather than during the compilation.
But, I'm not an expert here and I can be wrong.

Anyway, I solved it upgrading to typescript 3.3.1

@cdelgadob thanks for the info. I'll have to look into upgrading.

Looks like this hasn't been causing any more problems in recent version of TS and AS, so I'm going to go ahead and close it for now. If anyone else encounters this we can certainly take another look!

Was this page helpful?
0 / 5 - 0 ratings