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

JSX - "NPM tarball transpile [possibly] not working correctly for TSX" #996

Open
philcockfield opened this issue Feb 28, 2025 · 0 comments

Comments

@philcockfield
Copy link

philcockfield commented Feb 28, 2025

Minimal reproduction repo at: https://github.com/philcockfield/deno-jsr-jsx-issue
Detailed notes in README

gh repo clone philcockfield/deno-jsr-jsx-issue
cd ./deno-jsr-jsx-issue/sample-vite
deno task install  # NB: runs `deno install` with --allow-scripts to ensure the Vite plugins fully install.
deno task dev

Context

In or around the release of deno 2.2 the JSX warnings for unsupported-jsx-tsx were removed, suggesting the ability to cleanly publish JSX components from within a .tsx file of a package publishing into JSR.

The sample repo shows an error when importing into a Deno + Vite application, a JSR published module that exports a React/JSX component from a .tsx file, with no special 3rd part bundling or transpliation. Just what Deno/JSR prepares as it publishes the module.

@lucacasonato suggested this may be an issue with the "NPM tarball transpile [maybe] not working correctly for TSX."


Reproduction

Details in the README of the reproduction repo:

Image

import { Foo } from "jsr:@phil/sample-react";

Image

Uncaught TypeError: jsx is not a function
    at Foo (3b0776a9ba7e06247b86872206782c780652c681df9eb853b3bc6015c5772816:7:26)
@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Feb 28, 2025
@philcockfield philcockfield changed the title JSX/React - possible "NPM tarball transpile not working correctly for TSX" JSX/React - "NPM tarball transpile [possibly] not working correctly for TSX" Feb 28, 2025
@philcockfield philcockfield changed the title JSX/React - "NPM tarball transpile [possibly] not working correctly for TSX" JSX - "NPM tarball transpile [possibly] not working correctly for TSX" Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant