iway1 / trpc-panel

MIT License
627 stars 43 forks source link

bug: Failed to parse procedure, couldn't parse node #104

Open dBianchii opened 2 months ago

dBianchii commented 2 months ago

image

diegoasanch commented 2 months ago

I'm having the same error.

 ○ Compiling /api/panel ...
 ✓ Compiled /api/panel in 1270ms (395 modules)
trpc-panel: Failed to parse procedure test, Couldn't parse node.
trpc-panel: Failed to parse procedure joinWaitlist, Couldn't parse node.
trpc-panel: Failed to parse procedure , Router doesn't have any successfully parsed children.

These are the relevant dependency versions from my package.json

{ 
  "dependencies": {
    "@tanstack/react-query": "^5.29.0",
    "@trpc/client": "11.0.0-rc.334",
    "@trpc/next": "11.0.0-rc.334",
    "@trpc/react-query": "11.0.0-rc.334",
    "@trpc/server": "11.0.0-rc.334",
    "next": "14.1.4",
    "superjson": "^2.2.1",
    "trpc-panel": "^1.3.4",
    "zod": "^3.22.4"
  }
}

And pages/api/panel.ts

import { appRouter } from '@/server/routers/_app'
import type { NextApiRequest, NextApiResponse } from 'next'
import { renderTrpcPanel } from 'trpc-panel'

export default async function handler(_: NextApiRequest, res: NextApiResponse) {
  res.status(200).send(
    renderTrpcPanel(appRouter, {
      url: 'http://localhost:3001/api/trpc',
      transformer: 'superjson',
    }),
  )
}
diegoasanch commented 2 months ago

For me downgrading tRPC to 10.45.2 and @tanstack/react-query to4.18.0 fixed it

{
    "@tanstack/react-query": "^4.18.0",
    "@trpc/client": "^10.45.2",
    "@trpc/next": "^10.45.2",
    "@trpc/react-query": "^10.45.2",
    "@trpc/server": "^10.45.2",
}
MinskLeo commented 1 month ago

@diegoasanch @dBianchii Possible solution for your case in separate issue: https://github.com/iway1/trpc-panel/issues/95

kevinssheva commented 1 week ago

I have the same issues