Closed Truemedia closed 3 years ago
The same is happening to me, but trying to run my application on Windows 10 on an Android emulator and even on my android phone throug Expo
(v32.0.0).
apollo-utilities
v1.1.3 has a dependency on graphql
which is not mentioned in its package.json
but it is mentioned as a peerDependency for Apollo-client
to resolve it, I ran: npm install -s graphql
@dysonpro that's it... I totally forgot to check my installed dependecies...
The graphql
package is a peer dependency of apollo-utilities
now, which is our general policy for Apollo packages because we really don't want multiple copies of graphql
getting installed, since that throws instanceof
for a loop.
For those still affected by this apollo-cache and graphql-anywhere also depend on graphql but don't list it as a peerDependency. PR with a fix: https://github.com/apollographql/apollo-client/pull/5081
hey i still got error, even after installing graphql
via yarn add graphql
I still have the issue after npm install graphql. Just like #https://github.com/Polymer/pwa-starter-kit/issues/362
hey i still got error, even after installing
graphql
viayarn add graphql
Here too
Hi, everyone. I managed to fix it. Created a Clean PWA Starter kit that works.
Key things i did:
See the webpack config folder. The current webpack config is quite minimal but happy to extend it.
The current project is "clean" so you would have to add graphql yourself. Let me know if you need a full example and i can try to work it out tomorrow
I'm getting the following error:
Failed to compile.
./node_modules/apollo-client/bundle.esm.js
Attempted import error: 'BREAK' is not exported from 'graphql/language/visitor'.
Do you guys have any idea what might cause this issue? I have graphql@^14.5.8
, apollo-boost@^0.4.4
and @apollo/react-hooks@^3.1.3
. Thanks for the help! :smile:
I'm getting the following error:
Failed to compile. ./node_modules/apollo-client/bundle.esm.js Attempted import error: 'BREAK' is not exported from 'graphql/language/visitor'.
Do you guys have any idea what might cause this issue? I have
graphql@^14.5.8
,apollo-boost@^0.4.4
and@apollo/react-hooks@^3.1.3
. Thanks for the help! 😄
I managed to fix this by adding '.mjs' to the list of filetypes for Webpack to resolve. Full example:
{
test: [/\.js$/, /\.mjs$/],
loader: require.resolve('babel-loader'),
options: {
...
}
}
Same issue there:
Unable to resolve "../graphql/client/fetchUser.graphql" from "pages/index.tsx"
under iOS simulator.
Is there any way to fix that issue?
Has there been any resolution here? When I install apollo-link-error
, I get this error during runtime
Module not found: Error: apollo-utilities tried to access graphql (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
and am only able to silence it by manually updating my yarn.lock file to include graphql as a peerDependency of apollo-link-error
- which I reeeally don't want to have to do.
package.json dependencies:
"dependencies": {
"@apollo/react-hooks": "3.1.5",
"@apollo/react-testing": "3.1.4",
"@types/graphql": "14.5.0",
"@types/react": "16.9.34",
"@types/zen-observable": "0.8.0",
"apollo-cache-inmemory": "1.6.5",
"apollo-client": "2.6.8",
"apollo-link": "1.2.14",
"apollo-link-error": "1.1.5",
"apollo-link-http": "1.5.17",
"apollo-link-retry": "2.2.16",
"apollo-utilities": "1.3.3",
"graphql": "14.6.0",
"graphql-tag": "2.10.1",
"react": "16.13.0",
"react-dom": "16.13.0",
"react-router-dom": "5.1.2",
"zen-observable": "0.8.15"
},
"devDependencies": {
"@hot-loader/react-dom": "16.13.0",
"@types/jest": "25.2.1",
"@types/node": "13.13.4",
"@types/react-dom": "16.9.5",
"@types/react-router-dom": "5.1.5",
"@types/react-test-renderer": "16.9.2",
"apollo": "2.27.0",
"jest": "25.5.2",
"react-test-renderer": "16.13.1"
}
@annabfenske - have a look at what i did to my own project to make it work. You can make the same changes to your bundler to make it work.
I got the error: "Module not found: Can't resolve 'graphql/language/visitor' "
beacuse i was importing "setContext" like this: "import { setContext } from 'apollo-link-context'"
I just changed to this : "import { setContext } from '@apollo/client/link/context'"
Docs: https://www.apollographql.com/docs/react/networking/authentication/
Hope it could help
This should no longer be an issue in @apollo/client@latest
- let us know otherwise, thanks!
i still have this error, i ran nextjs and nodejs on ubuntu server, i know its a very bad way to enable on server but im just testing, im planning to start it using pm2.
Intended outcome: Trying to use Apollo client with React native or Vue native using code from this recipe page https://www.apollographql.com/docs/react/recipes/react-native.html
Running the iOS simulator expect to see an app or error messages directly related to my app.
Actual outcome: When running the iOS simulator I get the message:
Extra message is module does not exist in haste map
How to reproduce the issue: Create a fresh React or vue native instance and try using the apollo client for a simple query
Versions System: OS: macOS High Sierra 10.13.6 Binaries: Node: 10.12.0 - /usr/local/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.8.0 - /usr/local/bin/npm Browsers: Chrome: 72.0.3626.119 Safari: 12.0.3 npmPackages: apollo-client: ^2.4.13 => 2.4.13 react-apollo: ^2.4.1 => 2.4.1