Did you mean 'typeof ConvexProvider'?
Example straight outta of next.js quickstart has the ConvexProvider component throwing this TS error.
"'ConvexProvider' refers to a value, but is being used as a type here. Did you mean 'typeof ConvexProvider'?ts(2749)"
"use client";
import { ReactNode } from "react";
import { ConvexProvider, ConvexReactClient } from "convex/react";
const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);
export function ConvexClientProvider({ children }: { children: ReactNode }) {
return <ConvexProvider client={convex}>{children}</ConvexProvider>;
}
4 Replies
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!
Bit of a stab in the dark, but does your filename end in
.tsx
(as opposed to .ts
)? That error message kind of sounds like it's trying to treat the <ConvexProvider ...>
as a type instead of as JSXOoof, good call. Messed that up. 🫠Easy solve, thanks!
I've torn my hair out over this in the past too