fawwaz
fawwaz•2y ago

Parameter has a name but no type

Hey all 👋 , I'm trying to create an internal action, but I'm seeing an error in the console saying Parameter has a name but no type. Did you mean 'arg0: Prediction'? I did some debugging and it seems that removing replicate from the import at the top remove the error 🤔 this my code not sure what I'm doing wrong here, are there packages that we can't use from actions ?
import { v } from "convex/values";
import { internalAction } from "./_generated/server";
import Replicate from "replicate";

export const firePrediction = internalAction({
args: {
prompt: v.string(),
},
handler: async (_, args) => {
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN!,
});
void replicate.run("stability-ai/sdxl:2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2", {
input: {
prompt: args.prompt,
},
// webhook:"",
// webhook_events_filter: ["completed"]
});
return Promise.resolve("success");
},
});
import { v } from "convex/values";
import { internalAction } from "./_generated/server";
import Replicate from "replicate";

export const firePrediction = internalAction({
args: {
prompt: v.string(),
},
handler: async (_, args) => {
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN!,
});
void replicate.run("stability-ai/sdxl:2b017d9b67edd2ee1401238df49d75da53c523f36e363881e057f5dc3ed3c5b2", {
input: {
prompt: args.prompt,
},
// webhook:"",
// webhook_events_filter: ["completed"]
});
return Promise.resolve("success");
},
});
No description
3 Replies
sshader
sshader•2y ago
This looks like a TypeScript error due to replicate's types. Does downgrading to a previous version of replicate resolve this (e.g. npm install replicate@0.13.0)?
ballingt
ballingt•2y ago
I just reported this to the author of that library https://github.com/replicate/replicate-javascript/issues/109 @fawwaz +1 to using 0.13 instead
fawwaz
fawwazOP•2y ago
Oh wow thanks guys that worked 🥳 and I just started using Convex but I think I'm already in love 👅

Did you find this page helpful?