veronikakocheto
CCConvex Community
•Created by veronikakocheto on 3/18/2024 in #support-community
convex function not pushing from VS code to convex project dashboard
Hey guys! I'm struggling for a full day trying to figure this out, my backend teammate had to cancel for our project so I'm in charge of getting convex to integrate now and all I've done is front end stuff before 😢 Im trying to push the convex function I've created in my VS code js file to my convex dashboard for the project but it is not showing up after a whole ton of troubleshooting. I am using this html script tag: <script src="https://unpkg.com/convex@1.10.0/dist/browser.bundle.js"></script>
<script>
const CONVEX_URL = "https://my-actual-url.convex.cloud";
const client = new convex.ConvexClient(CONVEX_URL);
client.onUpdate("messages:list", {}, (messages) =>
console.log(messages.map((msg) => msg.body)),
);
</script>
and this is the function in a js file under "functions" in my root directory: import { mutation } from "./_generated/server";
import { v } from "convex/values";
export const login = mutation({
args: { email: v.string(), password: v.string() },
handler: async ({ db }, { email, password }) => {
// Query for user information
const user = await db.table("users").filter(q => q.eq("email", email)).first();
// Placeholder for actual password verification
// In a real application, you should hash the password and compare hashes
if (user && user.password === password) {
return { status: "success", user: user };
} else {
return { status: "failed" };
}
},
});
I am using the command "npx convex deploy" in the VS Code terminal and it seems to be showing as successful but not showing up on my dashboard: ✔ Deployed Convex functions to https://yes-i-have-my-actual-link-here.convex.cloud
any help would be very much appreciated!!!!
6 replies