Closed JonathonRP closed 1 year ago
Please post a minimal reproducible example using stackblitz or codesandbox.
I just followed the example - import type { inferAsyncReturnType } from "@trpc/server";
export const createContext = async (event: RequestEvent) => { return { event } };
export type Context = inferAsyncReturnType
Which if followed creates this issue, simply removing async fixes this. Also the example docs for creating server needs createContext line.
A minimal reproducible example should contain all the code needed to reproduce the error and no more. You can create one here. Without that, I can't help you.
@ottomated fyi working on reproduction repo from the provided link
Okay, closing this issue until you post a non-working version 👍
@ottomated - repo
This is fixed in 1.0.1
When attempting to access ctx without (await ctx) properties return undefined and typescript thinks it's an object instead of promise... Looking for help to resolve this.
repo