TypeError: parser_1.Parser is not a constructor

Getting this error while creating Apollo gateway by following the article in “Federation 2 quickstart - Apollo GraphQL Docs”. I was able to generate the supergraph schema. But, when i try to run the gateway, i get this error.

Below are the dependencies being used and node version is 14.17.1:
“dependencies”: {

"@apollo/federation": "^0.14.1",

"@apollo/gateway": "^0.49.0",

"apollo-server": "^2.25.3",

"concurrently": "^5.1.0",

"graphql": "^15.0.0",

"json-server": "^0.17.0",

"node-fetch": "^2.6.7",

"nodemon": "^2.0.3"

},

Please help to guide me to fix this issue.

@kishorsn that’s a pretty old version of apollo-server, and you shouldn’t have to install @apollo/federation yourself. It doesn’t look like you followed the quickstart as is (since it would have lead to having more recent libraries installed). Maybe try uninstalling your first 3 Apollo dependencies, and npm install apollo-server @apollo/gateway again.

I cloned the project from Git referenced in the federation video. After i reinstalled, everything started working. Thanks for your help.

1 Like

@kishorsn Can you share which project and which video? I’d like to update the repo. Thanks!

Here you go - GitHub - mandiwise/space-camp-federation-demo: Demo code for my Apollo Space Camp talk.
This is mentioned in the Video in this link - Introduction to Apollo Federation - Apollo GraphQL Docs

1 Like