renardeins
renardeins
TtRPC
Created by renardeins on 8/15/2024 in #❓-help
Correct types and payload for the applyWSSHandler with createContext
upd: adding db to createContext fixed the problem:
export const createContext = async (
opts: CreateNextContextOptions | CreateWSSContextFnOptions,
) => {
const session = await getSession(opts);

console.log("createContext for", session?.user?.name ?? "unknown user");

return {
session,
db
};
};
export const createContext = async (
opts: CreateNextContextOptions | CreateWSSContextFnOptions,
) => {
const session = await getSession(opts);

console.log("createContext for", session?.user?.name ?? "unknown user");

return {
session,
db
};
};
4 replies
TtRPC
Created by renardeins on 8/15/2024 in #❓-help
Correct types and payload for the applyWSSHandler with createContext
Versions info:
"@trpc/client": "^11.0.0-rc.446",
"@trpc/next": "^11.0.0-rc.446",
"@trpc/react-query": "^11.0.0-rc.446",
"@trpc/server": "^11.0.0-rc.446",
"next": "^14.2.4",
"typescript": "^5.5.3"
"@trpc/client": "^11.0.0-rc.446",
"@trpc/next": "^11.0.0-rc.446",
"@trpc/react-query": "^11.0.0-rc.446",
"@trpc/server": "^11.0.0-rc.446",
"next": "^14.2.4",
"typescript": "^5.5.3"
Node:
> node -v
v20.11.1
> node -v
v20.11.1
4 replies