Which project does this relate to?
Create Tanstack App
Describe the bug
I ran pnpm create @tanstack/start@latest as instructed on tanstack.com/start/latest/docs/framework/react/quick-start When prompted to select add-ons I selected tRPC.
The tRPC demo route throws the following error: useTRPC() can only be used inside of a <TRPCProvider>
Your Example Website or App
N/A
Steps to Reproduce the Bug or Issue
Run
Choose:
Would you like to use Tailwind CSS?
│ Yes
│
◇ Select toolchain
│ None
│
◇ Select deployment adapter
│ Nitro (agnostic)
│
◇ What add-ons would you like for your project?
│ tRPC
│
◇ Would you like any examples?
│ none
go to the demo/trpc-todo route and it has the following error: useTRPC() can only be used inside of a <TRPCProvider>
Expected behavior
The demo route should have no problem utilizing tRPC
Screenshots or Videos
No response
Platform
- OS: macOS, Windows]
- Router / Start Version: latest
Additional context
I got it to work by adding the provider from the integrations
import{Provider}from"@/integrations/tanstack-query/root-provider";[...]functionRootDocument({ children }: {children: React.ReactNode}){const{ queryClient }=Route.useRouteContext();return(<htmllang="en"><head><HeadContent/></head><body><ProviderqueryClient={queryClient}><Header/>{children}<TanStackDevtoolsconfig={{position: "bottom-right",}}plugins={[{name: "Tanstack Router",render: <TanStackRouterDevtoolsPanel/>,},TanStackQueryDevtools,]}/></Provider><Scripts/></body></html>);}
Which project does this relate to?
Create Tanstack App
Describe the bug
I ran pnpm create @tanstack/start@latest as instructed on tanstack.com/start/latest/docs/framework/react/quick-start When prompted to select add-ons I selected tRPC.
The tRPC demo route throws the following error:
useTRPC() can only be used inside of a <TRPCProvider>Your Example Website or App
N/A
Steps to Reproduce the Bug or Issue
Run
Choose:
Would you like to use Tailwind CSS?
│ Yes
│
◇ Select toolchain
│ None
│
◇ Select deployment adapter
│ Nitro (agnostic)
│
◇ What add-ons would you like for your project?
│ tRPC
│
◇ Would you like any examples?
│ none
go to the
demo/trpc-todoroute and it has the following error:useTRPC() can only be used inside of a <TRPCProvider>Expected behavior
The demo route should have no problem utilizing tRPC
Screenshots or Videos
No response
Platform
Additional context
I got it to work by adding the provider from the integrations