[01:07:07| euskadi31 :~/Projects/acme > npm start
> [email protected] start /Users/euskadi31/Projects/acme
> tsc && concurrently "tsc -w" "lite-server"
node_modules/apollo-client/ObservableQuery.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/QueryManager.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/QueryManager.d.ts(2,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/QueryManager.d.ts(3,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/QueryManager.d.ts(9,60): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/actions.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/actions.d.ts(2,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/actions.d.ts(3,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/actions.d.ts(4,65): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/afterware.d.ts(1,1): error TS2688: Cannot find type definition file for 'isomorphic-fetch'.
node_modules/apollo-client/afterware.d.ts(3,15): error TS2304: Cannot find name 'IResponse'.
node_modules/apollo-client/afterware.d.ts(4,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/data/extensions.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/data/mutationResults.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/data/mutationResults.d.ts(2,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/data/mutationResults.d.ts(4,65): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/data/readFromStore.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/data/readFromStore.d.ts(2,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/data/readFromStore.d.ts(3,40): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/data/scopeQuery.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/data/scopeQuery.d.ts(3,30): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/data/writeToStore.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/data/writeToStore.d.ts(2,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/data/writeToStore.d.ts(4,40): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/errors.d.ts(1,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/errors.d.ts(2,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/errors.d.ts(3,30): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/index.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/index.d.ts(2,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/index.d.ts(4,46): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/middleware.d.ts(1,1): error TS2688: Cannot find type definition file for 'isomorphic-fetch'.
node_modules/apollo-client/middleware.d.ts(5,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/mutations/store.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/mutations/store.d.ts(2,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/mutations/store.d.ts(3,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/mutations/store.d.ts(5,30): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/networkInterface.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/networkInterface.d.ts(2,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/networkInterface.d.ts(3,1): error TS2688: Cannot find type definition file for 'isomorphic-fetch'.
node_modules/apollo-client/networkInterface.d.ts(5,41): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/networkInterface.d.ts(34,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(42,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(45,15): error TS2304: Cannot find name 'IResponse'.
node_modules/apollo-client/networkInterface.d.ts(46,14): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(52,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(55,37): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(58,77): error TS2304: Cannot find name 'IResponse'.
node_modules/apollo-client/networkInterface.d.ts(65,12): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/networkInterface.d.ts(68,110): error TS2304: Cannot find name 'RequestInit'.
node_modules/apollo-client/queries/getFromAST.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/queries/getFromAST.d.ts(2,67): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/queries/queryTransform.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/queries/queryTransform.d.ts(2,40): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/queries/store.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/queries/store.d.ts(2,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/queries/store.d.ts(3,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/queries/store.d.ts(6,44): error TS2307: Cannot find module 'graphql'.
node_modules/apollo-client/util/Observable.d.ts(1,1): error TS2688: Cannot find type definition file for 'node'.
node_modules/apollo-client/watchQueryOptions.d.ts(1,1): error TS2688: Cannot find type definition file for 'typed-graphql'.
node_modules/apollo-client/watchQueryOptions.d.ts(2,1): error TS2688: Cannot find type definition file for 'chai'.
node_modules/apollo-client/watchQueryOptions.d.ts(3,46): error TS2307: Cannot find module 'graphql'.
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/euskadi31/.nvm/versions/node/v4.2.2/bin/node" "/Users/euskadi31/.nvm/versions/node/v4.2.2/bin/npm" "start"
npm ERR! node v4.2.2
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-server" '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the acme package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && concurrently "tsc -w" "lite-server"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs acme
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls acme
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/euskadi31/Projects/acme/npm-debug.log
[01:07:19| euskadi31 :~/Projects/acme >
Closing in favor of #713, which I think is the same issue. Feel free to reopen if you don't think that's the case.
I had the same problem with an Angular 2 project.
Until something happens on that front, it helps to add the following to your devDependencies:
"@types/chai": "^3.4.34",
"@types/isomorphic-fetch": "0.0.30",
"typed-graphql": "^1.0.1",
And remove graphql-tag from dependencies.
@Urigo @kamilkisiela can one of you look into this and tell me if there's anything we could/should do in Apollo Client?
@helfer I talked with @stubailo somewhere here about that. ApolloClient probably includes /// <reference types="chai" />
inside one of the source files. It means that if someone uses TypeScript he has to install @types/chai
package. Which is totally wrong because chai
is being used inside tests.
Besides this package, why is that a problem? It's normal that TypeScript requires declarations. We install those packages with declarations as direct dependencies instead of devDeps but I really don't like it... We can also create a section inside the docs or README.md
about that with a information what packages need to be installed.
@kamilkisiela okay, thanks! I can't find `
As for installing the typings, we've opted for putting it in optionalDependencies for now, so at least it won't break the install. In the longer term, we should just document it in the readme (but that's one more thing to maintain...).
@helfer I thought about it more and it's a bit weird. It requires packages like typed-graphql
directly and it's not an error about missing declaration for some function from let's say graphql
package.
Before it was something like You need something to fulfill missing declaration for IResponse
. Now it says that you need to install specific package, the same as used in apollo-client
.
It seems like they changed something in TypeScript...
I'm not sure if I explained it clearly :)
@ValentinKlinghammer I followed your way to solve it, but there are still some errors:
"@types/chai": "^3.4.34",
"@types/isomorphic-fetch": "0.0.30",
"typed-graphql": "^1.0.1",
I use angular cli to build Angular2 APP, the error is as below:
`ERROR in /git/cm-worth/node_modules/apollo-client/transport/afterware.d.ts (4,15): Cannot find name 'Response'.
ERROR in /git/cm-worth/node_modules/apollo-client/transport/afterware.d.ts (11,16): Cannot find name 'Response'.
ERROR in /git/cm-worth/node_modules/apollo-client/transport/batchedNetworkInterface.d.ts (11,16): Cannot find name 'Response'.
ERROR in /git/cm-worth/node_modules/apollo-client/transport/networkInterface.d.ts (46,15): Cannot find name 'Response'.
ERROR in /git/cm-worth/node_modules/apollo-client/transport/networkInterface.d.ts (63,77): Cannot find name 'Response'.
webpack: Failed to compile.`
Most helpful comment
I had the same problem with an Angular 2 project.
Until something happens on that front, it helps to add the following to your devDependencies:
And remove graphql-tag from dependencies.