Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meteor/meteor and apollo-link-http are needed to use apollo-link-ddp #393

Open
durac opened this issue Aug 3, 2020 · 1 comment
Open

Comments

@durac
Copy link

durac commented Aug 3, 2020

I have a react-native project and want to use apollo-link-ddp with simpleddp but I'm getting following error:

Error: Unable to resolve module meteor/meteorfromnode_modules/apollo-link-ddp/dist/client/apollo-link-ddp.js: meteor/meteor could not be found within the project.

Is there some kind of workaround?
Here is my current code:

import { ApolloClient, InMemoryCache } from '@apollo/client';
import SimpleDDP from 'simpleddp';
import { simpleDDPLogin } from 'simpleddp-plugin-login';
import { DDPLink } from 'apollo-link-ddp';

const ddp = new SimpleDDP({
  endpoint: 'ws://localhost:3000/websocket',
  SocketConstructor: global.WebSocket,
   reconnectInterval: 5000,
}, [simpleDDPLogin]);
     
const client = new ApolloClient({
 link: new DDPLink({
 connection: ddp,
 socket: ddp.ddpConnection.socket,
}),
 cache: new InMemoryCache(),
});
@nkahnfr
Copy link

nkahnfr commented Aug 5, 2020

Hello @durac.

Current version of apollo-link-ddp is not compatible with Apollo Client 3.0.
@moberegger proposed a pull request (#392) to make it compatible, let's hope it will be merged quickly.

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

No branches or pull requests

2 participants