-
Notifications
You must be signed in to change notification settings - Fork 319
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
Can’t establish a connection to the server at ws://localhost:4000/ in any browser #86
Comments
Do you have the Docker containers running? - What comes out of the following in terminal:
Have you started based the tutorial?... If not, then could it be that you need to run
before
|
Thank you very much for your post. I read the tutorial. Then took this repository here. And I chose to use MongoDB. In the tutorial you do not describe the database parts. So I just tried it out on my own. The docker-compose.yml you already seen. Here as well the prisma.yml file:
After that I did the following steps:
Looks fine for me. And everything is working. Just like you can see from the images the websocket is an issue:
The Output of docker ps:
So also the What else do you need from me =) |
Maybe the reason is the following. The error says he is listening to the Websocket under the port But as you can see. The output says: So what do I need to change? I already tried to switch from 4466 to 4000 completely. But got an error. And I don't think this makes sense. Any idea? |
Have you started the back-end as well as the front-end, next to also Docker containers? The front-end, alias http://localhost:3000, is started from the root folder of the project with of course "npm start". With a tutorial, will you for instance see a React or a Vue start page. The back-end, alias http://localhost:4000, is started from the folder "server", also with "npm start". That is the one where you have the "Playground" from GraphQL. The http://localhost:4466 is the database. It runs from the Docker containers. If that is running, then will you be able see something on the local webpage (http://localhost:4466/_admin), even if the back-end does not run. (Prisma-page - do you use Prisma in your toturial?) Can you start all three instances?... Can you bring up all three screens in a browser?... |
Started front-end npm start: Started back-end npm start:
|
So the three endpoints run. That is nice. The errors you have now are related to the schema of prisma/graphql not fitting thee query - or the other way around. You will have to update the schema and run prisma deploy ... iteratively improve your schema until it works. This is now where the tutorial fails as an tutorial, as it isn't updated and lets you end up with something where you don't learn anything except in the hard way: You simply stuck and have to read a bunch of things like back in the old times to get wiser. The well selling "this is nice" effect is gone. Back to the hard work of learning. Contact the creator of the tutorial and ask him what he intends. I guess, I will do the same in my case. - Maybe the tutorial is abandoned? Maybe he is sick? |
I just again deleted the whole project. And downloaded again. Now these are my steps and experiences without changing any file:
So it could be something with my MongoDB. I gonna check that. Thank you. |
It seems that the datamodel is not Mongo compatible. So this is my current Mongo Setup
prisma.yml
But when I now start prisma with this datamodel.prisma setup
That's correct. So I just added the missing
Now again with a but on the website I get those errors again: It seems as if the datamodel ist not MongoDB compatible. I'm not so deep into it. Maybe someone has a cool idea. And for better analytics, here again the error message I get when I try to interact with the page:
|
I also have challenges with the data model in datamodel.prisma in the tutorial right now. It does not fit (The resolvers don't fit to the datamodel.prisma vice versa + etc.). So I can't help you further on that right now. I chose MySQL as data back-end. So problems in the tutorial aren't necessarily specific to MongoDB. |
Strange for me MySQL was working properly when I tried it yesterday. Okay so I gonna have a look on the datamodel and try fixing the issues. Thank you. |
I found time again. But also with updated packages. I cannot get it working with my MongoDB. So maybe @nikolasburk could you have a look on this. From my perspective the issue is somewhere on side of MongoDB version orthe prisma schema. Also I tried to use the latest mongo version via
But it's just failing and failing when I use docker-compose up. I mean I'm lost. With your demo server (endpoint: https://eu1.prisma.sh/kwoxer/test123/dev) it works perfectly. But as I want to use mongodb this is an error I have no idea about. Hopefully you find some time to have a look. Maybe the first issue is this on when I use |
I have the same issue like this. I cloned https://github.com/howtographql/react-apollo and did everything like the Readme says. Except the database connection.
For my connection I use MongoDB with:
Everything works fine. But I just get...
Chrome:
Firefox:
I'm not sure if I need to change the ports. But the readme does not say something like that. Also the https://github.com/howtographql/react-apollo/blob/master/server/prisma/prisma.yml is missing the endpoint.
What do I need to change to get the WebSocket connection working?
The text was updated successfully, but these errors were encountered: