Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hono JSX TypeScript types do not work in the TypeScript playground #3956

Open
tmcw opened this issue Feb 25, 2025 · 2 comments
Open

Hono JSX TypeScript types do not work in the TypeScript playground #3956

tmcw opened this issue Feb 25, 2025 · 2 comments

Comments

@tmcw
Copy link

tmcw commented Feb 25, 2025

What version of Hono are you using?

4.7.2

What runtime/platform is your app running on? (with version if possible)

TypeScript Playground

What steps can reproduce the bug?

Playground link: https://www.typescriptlang.org/play/?jsx=4#code/PQKhAIAECsGcA9x0SYAoUEYIJIFsAHAewCcAXAZSIFcSBjAU3AAsiA7I4ZcVNNO9rDLgAMgEs2AaxxsAQmKLgAvOAAUASmUA+cAG804cCQZlabNQcPgAPMzJ4ANuAcBDNgHMlAIgZsvWyysbACMiABMATwCgw2tgUMjoqzi7RyT1AG40AF8MoA

What is the expected behavior?

This JSX code should be typecheckable.

What do you see instead?

It produces an error:

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
This JSX tag requires the module path 'hono/jsx/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed.
JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.

Additional information

This is an issue for our platform as well because we use the same ATA system that TypeScript uses to acquire types. Of course, this is an unusual platform for typechecking code, but it's a reference implementation for some typescript users.

I did some digging and found that Hono versions up to 4.3.11 work, and then 4.4.0 does not work.

@tmcw tmcw added the triage label Feb 25, 2025
@yusukebe yusukebe added not bug and removed triage labels Mar 3, 2025
Copy link

This issue has been marked as stale due to inactivity.

@github-actions github-actions bot added the stale label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants