Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

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 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