iway1 / trpc-panel

MIT License
627 stars 43 forks source link

Breaks with latest @trpc/server update. #56

Closed veritymedia closed 1 year ago

veritymedia commented 1 year ago

Panel has stopped working properly since the update to 10.18.0 . The displayed procedures are not inline with the source. There are the following errors:

[0] ../../node_modules/.pnpm/trpc-panel@1.2.8_uamwai2jv2ctn4ekodsihtjimm/node_modules/trpc-panel/lib/src/parse/parseProcedure.d.ts(3,33): error TS2307: Cannot find module '@src/parse/parseNodeTypes' or its corresponding type declarations.

[0] ../../node_modules/.pnpm/trpc-panel@1.2.8_uamwai2jv2ctn4ekodsihtjimm/node_modules/trpc-panel/lib/src/parse/routerType.d.ts(24,45): error TS2694: Namespace '"/home/[usr]/code/my-app/node_modules/.pnpm/zod@3.21.4/node_modules/zod/lib/external"' has no exported member 'extendShape'.

There are several of the second error, just at different lines of routerType.d.ts file.

Cant downgrade as I need a new feature of tRPC (middleware.unstable_pipe).

iway1 commented 1 year ago

took a look at this, I'm not able to reproduce (was able to run the panel with @trpc/server 10.18.0 on trpc-panel v1.2.9). Does the issue only happen when unstable_pipe is used?

Anyone else experiencing this issue with trpc-panel v1.2.9? if you can provide a minimum repro I will check it out

veritymedia commented 1 year ago

I believe you are right. I made a simple repro. Seems to all work with latest ver packages. Sorry for the issue. It must be some demonic node thing thats spitting errors at me... or some config one liner that I'll spend a second day looking for... xD

veritymedia commented 1 year ago

Leaving for someone else, may it will help. After raking through many, many lines of code I realized I could import with CJS. It worked. Hours of my life gone. import { renderTrpcPanel } from "trpc-panel" **=>** const { renderTrpcPanel } = require( "trpc-panel") Dont know why it started acting that way after an update though. Javascript is a mystery.

iway1 commented 1 year ago

that is strange, and JS is indeed a mystery.