SG.devS
Convex Community2y ago
4 replies
SG.dev

Resend / Convex: Issue with Deploying JSX in Convex Environment - Unexpected Syntax Error

Can't for the life of me figure out how to resolve this issue. I'm encountering a deployment issue when using JSX within my Convex environment.

✖ Error: Unable to push deployment config to https://<deploymentUrl>
Error fetching POST  https://<deploymentUrl>/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
    error:
Failed to analyze emails.js: Uncaught SyntaxError: Unexpected token '<'


I've also added : "jsx": "react-jsx" under the compilerOptions in my /convex/tsconfig.json

Here is the code:

// emails.tsx

export const sendWelcomeEmail = async ({
  email,
  name,
}: {
  email: string;
  name: string;
}) => {
  const { error } = await resend.emails.send({
    from: "",
    to: email,
    subject: "Welcome",
    react: <WelcomeEmail name={name} />,
  });

  if (error) {
    console.error(error);
    throw new ConvexError({ message: error.message });
  }
};


I've also tried just calling the function like this and get the same error:
react: WelcomeEmail({name})


Any insight would be great, thanks guys!
Was this page helpful?