Getting "Client not specified" message
See original GitHub issueHey ! 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:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 usingnpx yarn-deduplicate
. So, nonohoist
should be necessary for anyurql
packages.@kitten That was it, thanks ! Forgot to use
withUrqlClient
on export of my registration page.