question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting "Client not specified" message

See original GitHub issue

Hey ! I’m new to URQL and got a problem trying to use it with NextJS; it doesn’t seems to take into account my client config into the Provider.

Console message:

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.

Couldn’t find anything about this issue on the web. Did I miss a step about configuration ?

I’ve generated my nextJS app with ā€œwith-ant-design-lessā€ config if it can help also.

Thanks for your help !

urql version & exchanges: Urql v1.10.0 Next v9.5.3

My _app.tsx:

// import App from "next/app";
import type { AppProps /*, AppContext */ } from 'next/app'
import React from 'react';
import {
    Layout as LayoutAD,
    Menu,
    Button,
    Space,
} from 'antd';
import { HomeFilled, SearchOutlined, UserOutlined } from '@ant-design/icons';
import { Provider, createClient } from 'urql';

const client = createClient({
  url: 'http://localhost:4000/graphql',
  fetchOptions: {
    credentials: 'include',
  },
});

const { Header, Content, Sider } = LayoutAD;

import '../styles/components/layout.less';


function MyApp({ Component, pageProps }: AppProps) {
        return (
          <Provider value={client}>
            <LayoutAD style={{ minHeight: '100vh', overflow: 'auto' }}>
            <Sider
              breakpoint="lg"
              collapsedWidth="0"
              onBreakpoint={broken => {
                console.log(broken);
              }}
              onCollapse={(collapsed, type) => {
                console.log(collapsed, type);
              }}
            >
              {/* <div className="logo" /> */}
              <div className="logo" style={{color: 'white', fontSize: '2rem', textAlign: 'center' }}>Dylt</div>
              <Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
                <Menu.Item key="1" icon={<HomeFilled />}>
                  Accueil
                  
                </Menu.Item>
                <Menu.Item key="2" icon={<SearchOutlined />}>
                  Explorer
                </Menu.Item>
                <Menu.Item key="3" icon={<UserOutlined />}>
                  Mon profil
                </Menu.Item>
              </Menu>
            </Sider>
            <LayoutAD>
              <Header className="site-layout-sub-header-background">
                  <Space>
                  <Button>Inscription</Button>
                  <Button type="primary">Connexion</Button>
                  </Space>
              </Header>
              <Content style={{ margin: '24px 16px 0' }}>
                <div className="site-layout-background" style={{ padding: 24, minHeight: 360 }}>
                    <Component {...pageProps} />
                </div>
              </Content>
            </LayoutAD>
          </LayoutAD>
          </Provider>
        );
};

export default MyApp;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kittencommented, Apr 7, 2021

@geisterfurz007 what’s important to note here is, while preventing a hoist here may have worked for now, Yarn generally tends to duplicate dependencies on upgrades or additional installs. The peer-dependency in next-urql specifically means that it’s supposed to use whichever version you’ve installed though. More importantly these issues can sometimes cause @urql/Core to be duplicated which leads to more severe issues.

That’s why we recommend instead to check for duplicates with yarn list --pattern=urql. If any nested duplicates come up then the lock file can often simply be fixed using npx yarn-deduplicate. So, no nohoist should be necessary for any urql packages.

1reaction
quentinbrohancommented, Sep 8, 2020

@kitten That was it, thanks ! Forgot to use withUrqlClient on export of my registration page.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Location for PPDS display error message "BW client ...
I want to create a location for Plant and Vendor, t-code /SAPAPO/LOC3 after I put mandatory information and save. there is an error...
Read more >
JSON always returning "client_id not specified" - Stack Overflow
I was able to retrieve an access token using application/x-www-form-urlencoded request:
Read more >
"Client home is not specified for connection" #1361 - GitHub
This IS my MySQL client, I can change data and create databases etc. The only way to get that mysqldump.exe as far as...
Read more >
"The WinRM client cannot process the request. Basic ...
Connecting to remote server api.interfaces.records.teams.microsoft.com failed with the following error message: The WinRM client cannot process ...
Read more >
SAP message E2258 Specify a client-specific application
What causes this issue? The table is defined with delivery class A (application table - master data and movement data) but does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found