fawwazF
Convex Communityโ€ข3y agoโ€ข
4 replies
fawwaz

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");
  },
});
image.png
Was this page helpful?