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

Cannot find module '@kitajs/html/jsx-runtime' or its corresponding type declarations with NodeJS and module package #206

Open
2 tasks done
mattdean-digicatapult opened this issue May 8, 2024 · 2 comments

Comments

@mattdean-digicatapult
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Versions

kitajs/html: 4.1.0
typescript: 5.4.5
node: 22.0.0

Description

Cannot build a package with "type": "module" using tsc for NodeJS. Doing so seems to always result in the error Cannot find module '@kitajs/html/jsx-runtime' or its corresponding type declarations. I believe this is because the output is doing a deep import on a jsx-runtime without a file extension.

I do not believe this is a duplicate of #150 even though it looks very similar. In that case everyone commenting was using Bun as the runtime in this instance I'm using Node. Apologies if I'm doing something silly.

Steps to Reproduce

I've produced a repoduction at https://github.com/mattdean-digicatapult/kitajs-html-example. In short to reproduce checkout that repo and just do:

npm i
npm run build

build is just running tsc if you'd prefer

Expected Behavior

The build to succeed.

@Markyiptw
Copy link

I got the same issue. @kitajs/html only works with CommonJS but not ES module in NodeJS.

@arthurfiorette
Copy link
Member

Please use the alternative way to configure jsx until the next release

https://github.com/kitajs/html/tree/master/packages/html#alternative-way-to-configure-your-tsconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants