hono icon indicating copy to clipboard operation
hono copied to clipboard

JSX conflict with React email components

Open vickyRathee opened this issue 1 year ago • 3 comments

What version of Hono are you using?

4.5.2

What runtime/platform is your app running on?

Cloudflare pages

What steps can reproduce the bug?

The JSX has lots of conflicts with @react-email/components and unable to build the email templated using react-email. Here is my tsconfig.json

image

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true,
    "skipLibCheck": true,
    "lib": [
      "ESNext"
    ],
    "types": [
      "@cloudflare/workers-types",
    ],
    "jsx": "react-jsx",
    "jsxImportSource": "hono/jsx"
  },
}

What is the expected behavior?

There should not be any conflict I guess

What do you see instead?

JSX conflict with other library compnents

Additional information

No response

vickyRathee avatar Jul 28 '24 04:07 vickyRathee

Hi @vickyRathee

How about adding the declaration at the top of the code?

/** @jsxImportSource react */

yusukebe avatar Jul 28 '24 06:07 yusukebe

@yusukebe Awesome, working fine with that.

vickyRathee avatar Jul 29 '24 15:07 vickyRathee

@yusukebe the latest version of react-email doesn't work. It throws an Uncaught ReferenceError: MessageChannel is not defined Error

Image

vickyRathee avatar Oct 24 '25 05:10 vickyRathee