How best to use jsx / tsx entry point with `cloudflare pages dev`

I am using vanilla Cloudflare Pages Functions with
cloudflare pages dev
and I'm experimenting with
@vercel/og
using the plug-in (https://github.com/cloudflare/pages-plugins/tree/main/packages/vercel-og) as documented in the Generate arbitrary images section (https://developers.cloudflare.com/pages/functions/plugins/vercel-og/#generate-arbitrary-images). I have it working with plain js (
React.createElement
), but when using jsx like in the examples I get a parse error from
es-module-lexer
when
miniflare
is trying to get the entry points as the parser doesn't support jsx. Is there any way to use jsx / tsx without another framework that relies on building with vite or webpack? It seems to compile ok when using
wrangler pages functions build
, although it's not transforming the jsx into plain js.
Was this page helpful?