Replies: 4 comments
-
Did you figure out the solution for clerk? |
Beta Was this translation helpful? Give feedback.
-
I also had this issue when migrating an existing t3 app to this structure and all i came up with is this lousy workaround: type SignedInAuthObject = {
sessionId: string;
userId: string;
};
type SignedOutAuthObject = {
sessionId: null;
userId: null;
};
type AuthObject = SignedInAuthObject | SignedOutAuthObject;
export const createTRPCContext = async (opts: {
headers: Headers;
auth: AuthObject;
token: string | null;
}) => {
return {
db,
...opts,
};
}; Basically defining your own types for the auth property... Works, if you dont need any of the other properties. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
You should open an issue in Clerk for this. Basically they don't export enough of their types to support declaration: true. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I am replacing Next-auth with Clerk.
Here is the creation of TRPC context in the
api
packageHowever, by doing so I get the following type error:
I managed to solve the issue by modifying the
tsconfig
of the API package, but I guess ideally I should be able to set these properties as true:Here are the dependencies of the API package:
Did someone already manage to integrate Clerk without this issue ?
I'm not sure if this is an issue with my configuration, t3-turbo or Clerk package.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions