acronie
acronie
TtRPC
Created by acronie on 11/26/2023 in #❓-help
WS with TRPC
which go on as websocket event and not http request then emitting inside the mutation
8 replies
TtRPC
Created by acronie on 11/26/2023 in #❓-help
WS with TRPC
@marcos daniel have you figured out how you would emit events from the client?
8 replies
TtRPC
Created by acronie on 11/26/2023 in #❓-help
WS with TRPC
Also I have a doubt I just see yk a way to subscribe to updates? But not a way to emit an event from the client? is there some catch here
8 replies
TtRPC
Created by acronie on 11/26/2023 in #❓-help
WS with TRPC
I am using express adapter
8 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
I don't know whats wrong at this point
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
const createInnerTRPCContext = (opts: CreateContextOptions) => {
console.log("DB FROM INNER CONTEXT", opts.db);
return {
db: opts.db,
request: opts.request,
};
};
const createInnerTRPCContext = (opts: CreateContextOptions) => {
console.log("DB FROM INNER CONTEXT", opts.db);
return {
db: opts.db,
request: opts.request,
};
};
even this doesn't log..
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
a normal request works to the api
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
happens with both mutations and queries
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
anyone got any idea why this could be happening?
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
import { createNextApiHandler } from "@trpc/server/adapters/next";
import { withIronSessionApiRoute } from "iron-session/next";
import { env } from "@/env.mjs";
import { appRouter } from "@/server/api/root";
import { createTRPCContext } from "@/server/api/trpc";
import { NextApiRequest, NextApiResponse } from "next";
import { sessionOptions } from "@/utils/session";

const handler = (req: NextApiRequest, res: NextApiResponse) => {
return createNextApiHandler({
router: appRouter,
createContext: createTRPCContext,
onError:
env.NODE_ENV === "development"
? ({ path, error }) => {
console.error(
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`,
);
}
: undefined,
})(req, res);
};
export default withIronSessionApiRoute(handler, sessionOptions);
import { createNextApiHandler } from "@trpc/server/adapters/next";
import { withIronSessionApiRoute } from "iron-session/next";
import { env } from "@/env.mjs";
import { appRouter } from "@/server/api/root";
import { createTRPCContext } from "@/server/api/trpc";
import { NextApiRequest, NextApiResponse } from "next";
import { sessionOptions } from "@/utils/session";

const handler = (req: NextApiRequest, res: NextApiResponse) => {
return createNextApiHandler({
router: appRouter,
createContext: createTRPCContext,
onError:
env.NODE_ENV === "development"
? ({ path, error }) => {
console.error(
`❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`,
);
}
: undefined,
})(req, res);
};
export default withIronSessionApiRoute(handler, sessionOptions);
this is how the handler looks like
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
- wait compiling /api/trpc/[trpc] (client and server)...
- event compiled successfully in 605 ms (142 modules)
- wait compiling /api/trpc/[trpc] (client and server)...
- event compiled successfully in 605 ms (142 modules)
the trpc server seems to be compiling
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
and next version
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
"next": "13.4.12",
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
"@trpc/client": "^10.38.3",
"@trpc/next": "^10.38.3",
"@trpc/react-query": "^10.38.3",

"@trpc/client": "^10.38.3",
"@trpc/next": "^10.38.3",
"@trpc/react-query": "^10.38.3",

18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
No description
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
Because I am using server side calls in some places by creating a caller
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
I noticed this seems to be happening with the hooks only
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
const { data: news } = api.news.getAllNews.useQuery();
18 replies
TtRPC
Created by acronie on 9/20/2023 in #❓-help
Showing pending inside the request?
No description
18 replies
TtRPC
Created by acronie on 9/7/2023 in #❓-help
Bad request in prod but works fine in dev
Works locally
39 replies