Paul
Paul•3mo ago

Could not find public function

All of a sudden I'm getting:
Ok([Request ID: 2333d44835d22263] Server Error
Could not find public function for 'users:getUserById'. Did you forget to run `npx convex dev` or `npx convex deploy`?
)
Ok([Request ID: 2333d44835d22263] Server Error
Could not find public function for 'users:getUserById'. Did you forget to run `npx convex dev` or `npx convex deploy`?
)
The query:
export const getUserbyId = query({
args: { id: v.string() },
handler: async ({ db }, args) => {
return await db.query("users")
.withIndex("idx_id", (q) => q.eq("id", args.id))
.first();
},
});
export const getUserbyId = query({
args: { id: v.string() },
handler: async ({ db }, args) => {
return await db.query("users")
.withIndex("idx_id", (q) => q.eq("id", args.id))
.first();
},
});
I'm using rust and I have 2 queries:
let token_result = client.query("tokens:getAccessTokenById", maplit::btreemap!{
"id".into() => access_token_uuid.to_string().into()
}).await;

println!("{:?}", token_result);
let user_result = client.query("users:getUserById", maplit::btreemap!{
"id".into() => user_id.to_string().into()
}).await;

println!("{:?}", user_result);
let token_result = client.query("tokens:getAccessTokenById", maplit::btreemap!{
"id".into() => access_token_uuid.to_string().into()
}).await;

println!("{:?}", token_result);
let user_result = client.query("users:getUserById", maplit::btreemap!{
"id".into() => user_id.to_string().into()
}).await;

println!("{:?}", user_result);
The first one gets executed and the second doesn't?
No description
7 Replies
Paul
PaulOP•3mo ago
If I manipulate the users file:
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/api.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/api.js
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/dataModel.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/server.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/server.js
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/schema.ts
[verbose] 2025-02-12T15:09:27.465Z Preparing convex/tokens.ts
[verbose] 2025-02-12T15:09:27.465Z Preparing convex/users.ts
Convex's runtime modules: [ 'tokens.js', 'users.js', '_deps/YB7C7KE2.js' ]
Remote config will be overwritten with the following changes:
Delete the following modules:
[-] users.js
Add the following modules:
[+] users.js (1.2 KB, source map 2153)

āœ” 15:09:27 Convex functions ready! (179.51ms)
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/api.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/api.js
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/dataModel.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/server.d.ts
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/_generated/server.js
[verbose] 2025-02-12T15:09:27.465Z Skipping convex/schema.ts
[verbose] 2025-02-12T15:09:27.465Z Preparing convex/tokens.ts
[verbose] 2025-02-12T15:09:27.465Z Preparing convex/users.ts
Convex's runtime modules: [ 'tokens.js', 'users.js', '_deps/YB7C7KE2.js' ]
Remote config will be overwritten with the following changes:
Delete the following modules:
[-] users.js
Add the following modules:
[+] users.js (1.2 KB, source map 2153)

āœ” 15:09:27 Convex functions ready! (179.51ms)
Is there a way of getting more verbose log from convex_backend ? I'm self hosting. I changed getUserbyId to getPants and it works. šŸ˜‚ Are there any prefixes I'm not supposed to use? It works now fine. Must be a gremlin. closing...
Paul
PaulOP•3mo ago
Reopening:
Ok([Request ID: 8d0fb5a63483d418] Server Error
Could not find public function for 'emailVerificationToken:getCodebyCode'. Did you forget to run `npx convex dev` or `npx convex deploy`?
)
Ok([Request ID: 8d0fb5a63483d418] Server Error
Could not find public function for 'emailVerificationToken:getCodebyCode'. Did you forget to run `npx convex dev` or `npx convex deploy`?
)
I'm getting the issue again. As per the image. It's definitely there but... šŸ¤”
No description
erquhart
erquhart•3mo ago
In both cases this is a capitalization problem. getCodebyCode !== getCodeByCode.
Paul
PaulOP•3mo ago
Good catch. I've got it fixed by now! It would be nice if there was actual feedback from the server insteea of just the usual
āœ” 15:09:27 Convex functions ready! (179.51ms)
ballingt
ballingt•3mo ago
You can! Are you running the binary or the docker image?
Paul
PaulOP•3mo ago
Oh nice. Running from the binary.
ballingt
ballingt•3mo ago
Hmmm try some Rust logging environment variables? I think those are runtime, not build-time.

Did you find this page helpful?