Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Bug with last release of @apollo/react-ssr. Cannot find module apollo-client #3989

Open
debugpai opened this issue May 26, 2020 · 1 comment

Comments

@debugpai
Copy link

Actual outcome:
When using @apollo/[email protected] and @apollo/[email protected]
I'm getting the error

Cannot find module 'apollo-client'
Require stack:
- /Users/dthonse/workspace/capla/node_modules/@apollo/react-hooks/lib/react-hooks.cjs.js
- /Users/dthonse/workspace/capla/node_modules/@apollo/react-ssr/lib/react-ssr.cjs.js

I think the problem was happening because there was a dependency on @apollo/react-hooks which has now been removed.

This is quite strange since this change was done on September last year

and a new version was released on April This year

But if you download the source files in that release, you would see that it still has
import { RenderPromises } from '@apollo/react-hooks/

How to reproduce the issue:

Version
@apollo/[email protected] and @apollo/[email protected]

System:
OS: macOS Mojave 10.14.6
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
Browsers:
Chrome: 81.0.4044.138
Firefox: 76.0.1
Safari: 13.1

@advl
Copy link

advl commented Jun 6, 2020

Same error in the same conditions


Error: Cannot find module 'apollo-client'
Require stack:
- /template-react-ssr/node_modules/@apollo/react-hooks/lib/react-hooks.cjs.js
- /template-react-ssr/node_modules/@apollo/react-ssr/lib/react-ssr.cjs.js
- /template-react-ssr/src/ssr/renderer.gql.js

EDIT : An update to @apollo/[email protected] seems to fix it

EDIT2 : I confirm I got it working completely with the @4 beta version, which is what is intended perghttps://github.com/apollographql/react-apollo .

ACTION SUGGESTED : Update the docs on apollo website, explaining that for usage with @apollo/client, @apollo/react-ssr needs to be updated to v4

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

2 participants