Upgrade from 1.17.0 to 1.17.2: Error: Could not find Convex client!

I upgraded my project that had no errors whatsoever from 1.17.0 to 1.17.2 and now get this error:
Error occurred prerendering page "/sign-in". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Could not find Convex client! `ConvexQueryCacheProvider` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app
Error occurred prerendering page "/sign-in". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Could not find Convex client! `ConvexQueryCacheProvider` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app
These are my providers: layout.tsx
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body
className={cn(
GeistSans.className,
"min-h-screen bg-background antialiased",
)}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<ClerkProvider dynamic>
<ConvexClientProvider>
<ConvexQueryCacheProvider>{children}</ConvexQueryCacheProvider>
</ConvexClientProvider>
</ClerkProvider>
</ThemeProvider>
</body>
</html>
);
}
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body
className={cn(
GeistSans.className,
"min-h-screen bg-background antialiased",
)}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<ClerkProvider dynamic>
<ConvexClientProvider>
<ConvexQueryCacheProvider>{children}</ConvexQueryCacheProvider>
</ConvexClientProvider>
</ClerkProvider>
</ThemeProvider>
</body>
</html>
);
}
convex-client-provider.tsx
"use client";

import { useAuth } from "@clerk/nextjs";
import { env } from "~/env";
import { makeUseQueryWithStatus } from "convex-helpers/react";
import { useQueries } from "convex-helpers/react/cache/hooks";
import { ConvexReactClient } from "convex/react";
import { ConvexProviderWithClerk } from "convex/react-clerk";
import { type ReactNode } from "react";

const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL);

export const useQueryWithStatus = makeUseQueryWithStatus(useQueries);

export default function ConvexClientProvider({
children,
}: {
children: ReactNode;
}) {
return (
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
{children}
</ConvexProviderWithClerk>
);
}
"use client";

import { useAuth } from "@clerk/nextjs";
import { env } from "~/env";
import { makeUseQueryWithStatus } from "convex-helpers/react";
import { useQueries } from "convex-helpers/react/cache/hooks";
import { ConvexReactClient } from "convex/react";
import { ConvexProviderWithClerk } from "convex/react-clerk";
import { type ReactNode } from "react";

const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL);

export const useQueryWithStatus = makeUseQueryWithStatus(useQueries);

export default function ConvexClientProvider({
children,
}: {
children: ReactNode;
}) {
return (
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
{children}
</ConvexProviderWithClerk>
);
}
I never had this error. It just happened while trying to upgrade.
14 Replies
Convex Bot
Convex Botβ€’5w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
ballingt
ballingtβ€’4w ago
@FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ You might have two different versions of Convex installed now, maybe try deleting node_modules directories and reinstalling? frustrating to hear this is happening to folks from simple upgrades also try upgrading convex-helpers β€”Β this shouldn't matter, but that can be a way to make sure convex-helpers is using the same copy of Convex as you have installed
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
hmm interesting, I was just reviewing the PR from my renovate bot which threw the error: https://github.com/FleetAdmiralJakob/chat-io/pull/724 but when doing it myself by updating the package.json and running pnpm i it worked: https://github.com/FleetAdmiralJakob/chat-io/pull/735 πŸ€·β€β™‚οΈ
GitHub
fix(deps): update dependency convex to v1.17.2 - autoclosed by reno...
This PR contains the following updates: Package Change Age Adoption Passing Confidence convex (source) 1.17.0 -&gt; 1.17.2 Release Notes get-convex/convex-js (convex) v1.17.1 U...
GitHub
fix(deps): updated convex by FleetAdmiralJakob Β· Pull Request #735 ...
Summary by CodeRabbit New Features Enhanced user-friendly error messages for sign-in scenarios. Added a loading state during form submission for better user experience. Bug Fixes Improved er...
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
Lol, tried to upgrade from 1.17.2 to 1.17.3 again. Same error lol. I wonder what the problem is. This time nothing complained on the merge of the renovate pr but on another completely unrelated pr it threw this error.
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
This PR went through without any problem: https://github.com/FleetAdmiralJakob/chat-io/pull/724 But then in prod it threw the error:
GitHub
fix(deps): update dependency convex to v1.17.3 by renovate[bot] Β· P...
This PR contains the following updates: Package Change Age Adoption Passing Confidence convex (source) 1.17.2 -&gt; 1.17.3 Release Notes get-convex/convex-js (convex) v1.17.3 F...
No description
ballingt
ballingtβ€’4w ago
Thanks for reporting these, what's the error?
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
Same. I was able to fix it by updating the package.json and pnpm i again, but I would like to know what the root cause is Because manually updating sucks
ballingt
ballingtβ€’4w ago
@FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ can we get more specific, what is the change that renovate makes to your repo and what is the change that you make to the repo?
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
For renovate im not sure, I will search it up, but for what Im doing thats pretty much it. Im just going in the package.json. Updating the version for convex and running pnpm i Renovate doesnt update the package.json because Im using the ^ specifier. Only the package lock For me it looks like it goes to every occurrence of convex there and bumps the version. It also updates the version of convex being used by convex-helpers etc.
ballingt
ballingtβ€’4w ago
huh, interesting! thanks interesting that that wouldn't be enough, I wonder why updating the package lock doesn't keep these consistent
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
Yes, very weird. Never had those problems in the padt with renovate.
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
GitHub
fix(deps): update dependency @sentry/nextjs to v8.46.0 by renovate[...
This PR contains the following updates: Package Change Age Adoption Passing Confidence @sentry/nextjs (source) 8.45.1 -&gt; 8.46.0 Release Notes getsentry/sentry-javascript (@​s...
GitHub
fix(deps): update dependency react-scan to ^0.0.50 by renovate[bot]...
This PR contains the following updates: Package Change Age Adoption Passing Confidence react-scan (source) ^0.0.49 -&gt; ^0.0.50 Release Notes aidenybai/react-scan (react-scan) ...
GitHub
fix(deps): update dependency @clerk/nextjs to v6.9.4 by renovate[bo...
This PR contains the following updates: Package Change Age Adoption Passing Confidence @clerk/nextjs (source) 6.9.3 -&gt; 6.9.4 Release Notes clerk/javascript (@​clerk/nextjs) v...
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
Ah yes, it was this PR this time but all the tests are passing on it. But after merging it the tests are failing again. Super weird. Super random. https://github.com/FleetAdmiralJakob/chat-io/pull/862
GitHub
fix(deps): update dependency convex to v1.17.4 by renovate[bot] Β· P...
This PR contains the following updates: Package Change Age Adoption Passing Confidence convex (source) 1.17.3 -&gt; 1.17.4 Configuration πŸ“… Schedule: Branch creation - At any time...
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
I dont understand what is the problem and how to fix it apart from bumbing everything yourself. Could it be that the convex versions of the convex libraries and the convex main project are out of sync? Now the PRs are working again Weird. I did not do anything. So random