Skip to content

Cannot publish packages with imported custom jsx-runtime #1098

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

Open
AljoschaMeyer opened this issue May 4, 2025 · 0 comments
Open

Cannot publish packages with imported custom jsx-runtime #1098

AljoschaMeyer opened this issue May 4, 2025 · 0 comments

Comments

@AljoschaMeyer
Copy link

I have been unable to publish packages to jsr which import a custom jsx-runtime from jsr.

Here is a minimal repository that reproduces the issue.

In that repo, I correctly configure a custom jsr runtime:

  "imports": {
    "macromania": "jsr:@wormblossom/macromania@^1.0.1",
    "macromaniajsx/jsx-dev-runtime": "jsr:@wormblossom/macromania@^1.0.1",
    "macromaniajsx/jsx-runtime": "jsr:@wormblossom/macromania@^1.0.1",
    "@std/assert": "jsr:@std/assert@^0.221.0"
  },

  "compilerOptions": {
    "jsx": "react-jsxdev",
    "jsxImportSource": "macromaniajsx",
    "lib": ["deno.ns", "dom"],
    "strict": true
  },

Deno can typecheck and compile everything, deno task test demonstrates that the jsx setup works.

Publishing to jsr, however, fails:

PS C:\Users\mail\projects\jsr_with_custom_jsx> deno publish
Checking for slow types in the public API...
'@aljoscha-meyer/jsr-with-custom-jsx' doesn't exist yet. Visit https://jsr.io/new?scope=aljoscha-meyer&package=jsr-with-custom-jsx&from=cli to create the package
Waiting...
Package @aljoscha-meyer/jsr-with-custom-jsx created
Visit https://jsr.io/auth?code=VJVU-QVQF to authorize publishing of @aljoscha-meyer/jsr-with-custom-jsx
Waiting...
Authorization successful. Authenticated as Aljoscha Meyer
Publishing @aljoscha-meyer/[email protected] ...
error: Failed to publish @aljoscha-meyer/[email protected]

Caused by:
    Failed to publish @aljoscha-meyer/jsr-with-custom-jsx at 1.0.0: failed to build module graph: Module not found "file:///macromaniajsx/jsx-runtime".
        at file:///mod.tsx:1:50

Publishing does work when depending on the runtime locally: see this deno.json whose package successfully published to jsr.

I'm on Windows 10, with deno 2.3.1:

PS C:\Users\mail\projects\jsr_with_custom_jsx> deno --version
deno 2.3.1 (stable, release, x86_64-pc-windows-msvc)
v8 13.5.212.10-rusty
typescript 5.8.3
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