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

createUrqlClient url not in force #6

Closed
caicaishmily opened this issue Sep 9, 2020 · 5 comments
Closed

createUrqlClient url not in force #6

caicaishmily opened this issue Sep 9, 2020 · 5 comments

Comments

@caicaishmily
Copy link

I just follow your tutorials,I set the url: "http://localhost:4000/graphql", but the browser can't found the server. here is my createUrqlClient.js snippet, Is there any setting to add ?

export const createUrqlClient = (ssrExchange: any) => ({
  url: "http://localhost:4000/graphql",
  fetchOptions: {
    credentials: "include" as const,
  },
  exchanges: [
    dedupExchange,
    cacheExchange({
      ... 
    }),
    ssrExchange,
    fetchExchange,
  ],
});

image

@benawad
Copy link
Owner

benawad commented Sep 9, 2020

from your screenshot it looks like it is making a request to localhost:3000 not localhost:4000

@caicaishmily
Copy link
Author

from your screenshot it looks like it is making a request to localhost:3000 not localhost:4000

Yes, But what make me feel confused is that I set the request url is localhost:4000. However, it request for localhost:3000. So weird.

@caicaishmily
Copy link
Author

from your screenshot it looks like it is making a request to localhost:3000 not localhost:4000

I cloned your repo then compare it with my code. I found the only difference between our code is the package.json file.
Then I copied your package.json and rm -rf node_modules && yarn install,
It worked.
Maybe it's caused by the dependency version.
Anyway, Thx a lot! @benawad

@voland62
Copy link

Got the same problem. This is iteresting.. Nothing helped, even caicaishmily's method...
It says:

Default Client: No client has been specified using urql's Provider.This means that urql will be falling back to defaults including making requests to /graphql.
If that's not what you want, please create a client and add a Provider.

But, then I found, if we replace yarn.lock from ben's repo(branch 15_urql-ssr in our case), all works after /node_modules refresh!...

@wandingistaken
Copy link

wandingistaken commented Mar 28, 2021

The same error happened to me logging because I forgot to wrap my login page with createUrqlClient
export default withUrqlClient(createUrqlClient)(Login);

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

4 participants