-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Labels
Description
Publishing a package to JSR which has jsx: "precompile"
doesn't work correctly. It unexpectedly falls back to the classic
jsx transform.
/** @jsxRuntime classic */
/** @jsxImportSource npm:[email protected] */
This in turn leads to errors when you're trying to use deno bundle
on these like in this case where I tried to bundle fresh:
bundler warning: The JSX import source cannot be set without also enabling React's "automatic" JSX transform[unsupported-jsx-comment]
at deno:https://jsr.io/@fresh/core/2.0.0-alpha.50/src/dev/middlewares/error_overlay/code_frame.tsx:1:48
Proposed solution
Falling back to the classic
jsx transform is wrong. It should be set to automatic
instead, or even precompile
although that might not work with other runtimes.
Steps to reproduce
- Clone https://github.com/marvinhagemeister/deno-publish-precompile-bug
- Update the
name
indeno.json
to whatever you desire - Publish to JSR with
deno publish
Example: https://jsr.io/@marvinh-test/deno-publish-precompile-bug/0.0.1/main.tsx
Version: Deno 2.4.3