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

Bug: Command deno add logs error for JSR package without default export #24607

Closed
csvn opened this issue Jul 16, 2024 · 2 comments · Fixed by #25102
Closed

Bug: Command deno add logs error for JSR package without default export #24607

csvn opened this issue Jul 16, 2024 · 2 comments · Fixed by #25102
Assignees
Labels
bug Something isn't working correctly

Comments

@csvn
Copy link

csvn commented Jul 16, 2024

When using deno add, I get errors if there is any JSR package that has no default export (.). For instance, installing @std/testing will make it so errors are printed every time I run deno add command. The command itself seems to succeed anyway, but the CLI command fails with a non-zero exit code, and a pretty verbose error message is printed. Is it mandatory to have a default export? If so, perhaps @std/testing should be updated, since it currently only has named subpath exports.

Reproduction steps

  1. Create a new folder
  2. Add JSR package via deno add with no . export (e.g. @std/testing@0.225.3)
    • deno add @std/testing@0.225.3
  3. Install any other JSR package (e.g. @std/json)

Actual results

When installing @std/testing@0.225.3 the following errors is printed:

Created deno.json configuration file.
Add @std/testing - jsr:@std/testing@^0.225.3
error: Unknown export '.' for '@std/testing@0.225.3'.
  Package exports:
 * ./asserts
 * ./bdd
 * ./mock
 * ./snapshot
 * ./time
 * ./types

Installing another package via deno add (e.g. @std/json) will print the same error again.

Add @std/json - jsr:@std/json@^0.224.1
error: Unknown export '.' for '@std/testing@0.225.3'.
  Package exports:
 * ./asserts
 * ./bdd
 * ./mock
 * ./snapshot
 * ./time
 * ./types

Expected results

No errors

Environment

OS: Windows 11
deno 1.45.2 (release, x86_64-pc-windows-msvc)
v8 12.7.224.12
typescript 5.5.2

@csvn csvn changed the title Command deno add logs error for JSR package without default export Bug: Command deno add logs error for JSR package without default export Jul 16, 2024
@dsherret dsherret added the bug Something isn't working correctly label Jul 16, 2024
@MujahedSafaa
Copy link
Contributor

Hi @csvn
I attempted to reproduce the bug, but I wasn't able to encounter the error you described. Did I miss something?
image

@sant123
Copy link

sant123 commented Jul 25, 2024

Pretty weird, I'm on Linux and I'm having the same issue:

image

Fedora 40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants