#Did you mean 'typeof ConvexProvider'?

5 messages · Page 1 of 1 (latest)

safe hemlock
#

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>;
}`

pliant mountainBOT
#

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!

simple kestrel
#

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 JSX

safe hemlock
#

Ooof, good call. Messed that up. 🫠 Easy solve, thanks!

simple kestrel
#

I've torn my hair out over this in the past too