Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Not compatible with [email protected]: Cannot find module 'graphql-anywhere/lib/async' #346

Closed
elliottsj opened this issue Feb 26, 2019 · 9 comments

Comments

@elliottsj
Copy link

apollo-link-state imports the path 'graphql-anywhere/lib/async', but this does not work with [email protected] since it now publishes this file as lib/async.umd.js:

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'graphql-anywhere/lib/async'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at connectionRemoveConfig.test (/Users/spencerelliott/path/to/node_modules/apollo-link-state/lib/bundle.umd.js:2:155)
    at Object.<anonymous> (/Users/spencerelliott/path/to/node_modules/apollo-link-state/lib/bundle.umd.js:5:2)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)

Should this have been considered a breaking change by graphql-anywhere? Not sure if the lib/async module is considered part of its public API.

@pehlse
Copy link

pehlse commented Feb 26, 2019

I have same error in production

@dustinbrink
Copy link

dustinbrink commented Feb 26, 2019

Same

Module not found: Can't resolve 'graphql-anywhere/lib/async' in 'C:\git\vqadmin\node_modules\apollo-link-state\lib'
(node:16944) UnhandledPromiseRejectionWarning: Error: Cannot find module 'C:\git\vqadmin\.next\build-manifest.json'

I had to add a resolution to my package.json to work around it for now

"resolutions": {
    "graphql-anywhere": "4.1.0",
  }

@lilactown
Copy link

Same, this was a transitive dependency of apollo-boost 0.1.4.

@koba1108
Copy link

The same error occurs even when using @nuxtjs/apollo.
https://github.com/nuxt-community/apollo-module

@whilelucky
Copy link

I added this to my dependencies and it works for now

"dependencies": {
  ...
  "graphql-anywhere": "4.1.0",
  ...
}

@andramalmen
Copy link

I added this to my dependencies and it works for now

"dependencies": {
  ...
  "graphql-anywhere": "4.1.0",
  ...
}

I can confirm that fixed it for me too

@njwest
Copy link

njwest commented Feb 27, 2019

+1 on this fix

"dependencies": {
  ...
  "graphql-anywhere": "4.1.0",
  ...
}

Thanks a ton for sharing this fix @lakshyaranganath, I ran into this error after doing a fresh npm install today an hour before a big UI prototype demo... almost didn't have a UI to demo!

That was a close one...

@hwillson
Copy link
Member

Thanks for reporting this all - this was fixed in apollographql/apollo-client#4503, and will de deployed shortly.

@skatcat31
Copy link

We found a different way of solving this problem: https://www.apollographql.com/docs/react/essentials/local-state.html#migrating

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants