T
Join ServertRPC
โ-help
Cannot read properties of undefined (reading 'createTRPCReact')
I'm trying to use it in an Astro project.
https://github.com/Industrial/test-astro-solid/blob/main/src/lib/trpc.ts
I think I implemented it as per the example https://trpc.io/docs/react#2-create-trpc-hooks
https://github.com/Industrial/test-astro-solid/blob/main/src/lib/trpc.ts
I think I implemented it as per the example https://trpc.io/docs/react#2-create-trpc-hooks
I don't know why.but please try pnpm install again or restart VSCode.
@backbone I did
rm -rf node_modules && pnpm install
and same thing@backbone could you run
git clone git@github.com:Industrial/test-astro-solid.git && cd test-astro-solid && pnpm i && pnpm dev
to reproduce ?Sorry, I would try this repo
Thank you ๐
I got it! I'm using SolidJS and not React so I don't need
react-query
.import { createResource } from 'solid-js'
import type { JSX } from 'solid-js/jsx-runtime'
import { trpc } from '@/lib/trpc'
export const Test = (): JSX.Element => {
const userId = '123'
const [user, { mutate, refetch }] = createResource(userId, async (id: string) => {
return await trpc.getUserById.query(id)
})
return <div>USER? {JSON.stringify(user())}</div>
}
That's all you need ๐