Skip to content

Cannot publish packages with imported custom jsx-runtime #1098

Open
@AljoschaMeyer

Description

@AljoschaMeyer

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/jsr-with-custom-jsx@1.0.0 ...
error: Failed to publish @aljoscha-meyer/jsr-with-custom-jsx@1.0.0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions