Sara
Sara3mo ago

Github Authentication issue with React Vite

I'm using convex auth with React, and I'm having an issue that hasn't occurred before with next.js I'm trying to log the user object, but it's returning null, and the functions of store and view don't appeared to be not working as well? here's some code snippets: in Main.tsx
import { ConvexReactClient } from "convex/react";
import { ConvexAuthProvider } from "@convex-dev/auth/react";


const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string,);

createRoot(document.getElementById('root')!).render(
<StrictMode>
<ConvexAuthProvider client={convex}>
<App />
</ConvexAuthProvider>
</StrictMode>,
)
import { ConvexReactClient } from "convex/react";
import { ConvexAuthProvider } from "@convex-dev/auth/react";


const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string,);

createRoot(document.getElementById('root')!).render(
<StrictMode>
<ConvexAuthProvider client={convex}>
<App />
</ConvexAuthProvider>
</StrictMode>,
)
in convex/users:
export const viewer = query({
args: {},
handler: async (ctx, args) => {
const userId = await getAuthUserId(ctx)
return userId !== null ? await ctx.db.get(userId):null
},
});
export const viewer = query({
args: {},
handler: async (ctx, args) => {
const userId = await getAuthUserId(ctx)
return userId !== null ? await ctx.db.get(userId):null
},
});
and here are some logs: I just need to understand what to do here
No description
5 Replies
Convex Bot
Convex Bot3mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
sshader
sshader3mo ago
Not sure what's causing `(void 0) is not a function' Can you turn on some more verbose logging? (https://labs.convex.dev/auth/debugging)
Debugging - Convex Auth
Authentication library for your Convex backend
Sara
SaraOP3mo ago
yep
Sara
SaraOP3mo ago
what am I supposed to be seeing?
No description
Sara
SaraOP3mo ago
ok my bad, I accidently clicked on "create app" not oath app, pardon me haha ok still the issue is occurring the issue is that I had installed the latest version of @auth/core@0.36.0