Darkside
Darkside2mo ago

Can't Prepare Convex functions

it keeps showing me this error for a lot of files , i am writing react . The esbuild loader for this file is currently set to "js" but it must be set to "jsx" to be able to parse JSX syntax. You can use "loader: { '.js': 'jsx' }" to do that.
9 Replies
Convex Bot
Convex Bot2mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
Darkside
DarksideOP2mo ago
I just ran the command npx convex dev, but ti fails to run and instead returns this error message for me " The esbuild loader for this file is currently set to "js" but it must be set to "jsx" to be able to parse JSX syntax. You can use "loader: { '.js': 'jsx' }" to do that."
erquhart
erquhart2mo ago
In convex/tsconfig.json do you have compilerOptions.jsx set to true? A lot of files, that's unexpected, can you share the actual error output with some file names
ballingt
ballingt2mo ago
It sounds like you should use the .jsx extension for for these files instead of .js. Why do you want jsx syntax in your convex function? You might be importing these files by accident.
Darkside
DarksideOP2mo ago
I do not have a tsconfig.json file in my convex folder, this image has the error messages
No description
Darkside
DarksideOP2mo ago
These files are all in my node_modules
erquhart
erquhart2mo ago
Yeah if those errors are coming from convex dev, you’re importing react native dependencies to your convex files.
Darkside
DarksideOP2mo ago
Ok, let me look at my convex files properly...thank you So I imported format from date-fns, that's where the issues started from, had to remove my convex folder and generated a new one to fix it, because just removing format didn't solve it...thank you
erquhart
erquhart2mo ago
Glad it worked out! date-fns format does work fine in Convex functions though, and shouldn't cause any jsx files to be imported. But glad it's working 👍

Did you find this page helpful?