You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then in some procedure, 'output' is declared using userSchema schema.
This resulted in blank page when navigated to '/api/trpc-panel' which rendered this:
import { type Request, type Response } from "express";
import { renderTrpcPanel } from "trpc-panel";
import { appRouter } from "../routers/index";
export const trpcPanelMiddleware = (req: Request, res: Response) => {
return res.send(
renderTrpcPanel(appRouter, {
url: "/api/trpc",
transformer: "superjson",
}),
);
};
I found out that when I change z.discriminatedUnion to z.union, everything starts to work again. But AFAIK, type narrowing works worse in z.union compared to z.discriminatedUnion.
I understand that that could be hard to fix/address, but I just wanted to leave that for others that could found themselves in similar problem.
The text was updated successfully, but these errors were encountered:
First of all: library is awesome and helps a lot during development. Thank you for you work!
Unfortunately I cannot show a code snippet due to security reasons but more or less the problem looks like described below.
And then in some procedure, 'output' is declared using
userSchema
schema.This resulted in blank page when navigated to '/api/trpc-panel' which rendered this:
I found out that when I change
z.discriminatedUnion
toz.union
, everything starts to work again. But AFAIK, type narrowing works worse inz.union
compared toz.discriminatedUnion
.I understand that that could be hard to fix/address, but I just wanted to leave that for others that could found themselves in similar problem.
The text was updated successfully, but these errors were encountered: