apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.76k stars 653 forks source link

Error: Cannot find module 'graphql-request' #1190

Closed neworld closed 5 years ago

neworld commented 5 years ago

On some machines I am getting error about missing module

> Task :app-graphql:generateDebugApolloIR FAILED
module.js:457
    throw err;
    ^

Error: Cannot find module 'graphql-request'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/neworld/projects/vinted/android/app-graphql/build/apollo-codegen/node_modules/graphql-config/lib/extensions/endpoints/EndpointsExtension.js:46:25)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

But it is interesting because that module actually exists:

➜  apollo-codegen ✗ npm list | grep graphql
apollo-android@0.0.1 /home/neworld/projects/vinted/android/app-graphql/build/apollo-codegen
  ├─┬ graphql@0.13.2
  ├─┬ graphql-config@1.2.1
  │ ├─┬ graphql@0.12.3
  │ ├─┬ graphql-import@0.4.5
  │ ├─┬ graphql-request@1.8.2

I double checked, that folder actually exists.

Need to mention, I am using apollo-codegen installed only locally via plugin. Globally I haven't apollo-codegen neither graphql-request

sav007 commented 5 years ago

Is it windows machine?

neworld commented 5 years ago

No, it is Linux. Also, some builds failed inside the Docker container as well.

neworld commented 5 years ago

Found a problem. This happened due mainframer, which by default do not sync back src folder. graphql-request and some other packages are storing their sources there.

Sorry for disturbing you.