Nitro does not transpile libraries from external registry (JSR)
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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