nitrojs / nitrojs/nitro

Nitro does not transpile libraries from external registry (JSR)

Open
#3,034 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment
  • Operating System: Linux
  • Node Version: v22.12.0
  • Nitro Version: 2.10.4
  • Package Manager: pnpm@9.15.4
Reproduction

https://github.com/arunanshub/nuxt-jsr-bug-repro/tree/nitro

Describe the bug

For some reason Nitro does not transpile libraries from external registry such as JSR even though its build output is supposed to be standalone. I am trying to use @std/ulid from JSR but in runtime Nitro cannot find it.

Also see https://github.com/nuxt/nuxt/issues/30737

Additional context

No response

Logs
[nitro] [request error] [unhandled] Cannot find package '@std/ulid' imported from /app/server/chunks/routes/api/ulid.get.mjs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and inspect the generated entry point at /app/server/chunks/routes/api/ulid.get.mjs, focusing on the runtime failure to resolve @std/ulid. Reproduce the deployment and verify that the standalone Nitro output can load @std/ulid from JSR without the Cannot find package error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.