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

deno install doesn't cache all JSR package exports #26498

Closed
kadumedim opened this issue Oct 23, 2024 · 1 comment · Fixed by #26501
Closed

deno install doesn't cache all JSR package exports #26498

kadumedim opened this issue Oct 23, 2024 · 1 comment · Fixed by #26501
Assignees
Labels

Comments

@kadumedim
Copy link

kadumedim commented Oct 23, 2024

Version: Deno 2.0.0

Running a deno install in a docker successful caches deps on subsequent builds but with some caveats.
Some packages are still being downloaded every time at runtime

Repro: https://github.com/kadumedim/deno-hono
Tested locally and on Railway.

Logs from Railway (ignore stderr)

Build:

2024-10-23T22:25:43.433103306Z [info] #9 [4/4] RUN deno install
2024-10-23T22:25:43.433106533Z [info] #9 0.065 Download https://jsr.io/@hono/hono/meta.json
2024-10-23T22:25:43.433109090Z [info] 
2024-10-23T22:25:43.614218063Z [info] #9 0.246 Download https://jsr.io/@hono/hono/4.6.6_meta.json
2024-10-23T22:25:43.614262770Z [info] 
2024-10-23T22:25:43.811172981Z [info] #9 0.292 Download https://jsr.io/@hono/hono/4.6.5_meta.json
2024-10-23T22:25:43.811212679Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/index.ts
2024-10-23T22:25:43.811217041Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/hono.ts
2024-10-23T22:25:43.811220299Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/hono-base.ts
2024-10-23T22:25:43.811225494Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/router/reg-exp-router/index.ts
2024-10-23T22:25:43.811228972Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/router/smart-router/index.ts
2024-10-23T22:25:43.811232191Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/router/trie-router/index.ts
2024-10-23T22:25:43.811235453Z [info] #9 0.325 Download https://jsr.io/@hono/hono/4.6.5/src/compose.ts
2024-10-23T22:25:43.811238437Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/context.ts
2024-10-23T22:25:43.811241549Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router.ts
2024-10-23T22:25:43.811244504Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/utils/url.ts
2024-10-23T22:25:43.811247245Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/reg-exp-router/router.ts
2024-10-23T22:25:43.811249923Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/smart-router/router.ts
2024-10-23T22:25:43.811252918Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/trie-router/router.ts
2024-10-23T22:25:43.811260303Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/request.ts
2024-10-23T22:25:43.811263185Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/utils/html.ts
2024-10-23T22:25:43.811265838Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/reg-exp-router/node.ts
2024-10-23T22:25:43.811268648Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/reg-exp-router/trie.ts
2024-10-23T22:25:43.811271381Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/router/trie-router/node.ts
2024-10-23T22:25:43.811276884Z [info] 
2024-10-23T22:25:43.811281123Z [info] #9 0.326 Download https://jsr.io/@hono/hono/4.6.5/src/utils/body.ts
2024-10-23T22:25:43.811284097Z [info] #9 DONE 0.4s

Deploy:

2024-10-23T22:25:58.000000000Z [info] Starting Container
2024-10-23T22:25:59.923460935Z [error] Download https://jsr.io/@hono/hono/4.6.5/src/middleware/cors/index.ts
2024-10-23T22:25:59.923480804Z [error] Listening on http://0.0.0.0:3000/
@nathanwhit nathanwhit self-assigned this Oct 23, 2024
@nathanwhit nathanwhit changed the title Bug: Dep caching deno install doesn't cache all JSR package exports Oct 23, 2024
@nathanwhit
Copy link
Member

Ah, the issue is that we only cache the root export from @hono/hono. This was sort of intentional, but now I'm thinking that behavior may be confusing. I'll open a PR

nathanwhit added a commit that referenced this issue Oct 24, 2024
…#26501)

Fixes #26498.

This was a sort of intentional decision originally, as I wanted to avoid
caching extra files that may not be needed. It seems like that behavior
is unintuitive, so I propose we cache all of the exports of listed jsr
packages when you run a bare `deno install`.
bartlomieju pushed a commit that referenced this issue Oct 25, 2024
…#26501)

Fixes #26498.

This was a sort of intentional decision originally, as I wanted to avoid
caching extra files that may not be needed. It seems like that behavior
is unintuitive, so I propose we cache all of the exports of listed jsr
packages when you run a bare `deno install`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants