m4rc3l05
m4rc3l052mo ago

Deno v2 deno install not installing all dep files

Hey, trying to create a docker image using deno v2 where i install dependencies before copying source files like
FROM docker.io/denoland/deno:alpine-2.0.0

RUN mkdir /app
RUN chown -R deno:deno /app

USER deno

WORKDIR /app

COPY --chown=deno:deno deno.json deno.lock .

RUN deno install --node-modules-dir
RUN deno eval "import '@db/sqlite'"

COPY --chown=deno:deno . .

RUN mkdir /app/data
VOLUME [ "/app/data" ]

EXPOSE 4321 4322
FROM docker.io/denoland/deno:alpine-2.0.0

RUN mkdir /app
RUN chown -R deno:deno /app

USER deno

WORKDIR /app

COPY --chown=deno:deno deno.json deno.lock .

RUN deno install --node-modules-dir
RUN deno eval "import '@db/sqlite'"

COPY --chown=deno:deno . .

RUN mkdir /app/data
VOLUME [ "/app/data" ]

EXPOSE 4321 4322
But i am running into a problem when i run the image i get an error:
error: Specifier not found in cache: "https://jsr.io/@hono/hono/4.6.2/src/jsx/jsx-runtime.ts", --cached-only is specified.
at file:///app/src/apps/web/app.tsx:1:1
error: Specifier not found in cache: "https://jsr.io/@hono/hono/4.6.2/src/jsx/jsx-runtime.ts", --cached-only is specified.
at file:///app/src/apps/web/app.tsx:1:1
My deno.json file looks like
{
...
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "@hono/hono/jsx"
},
"lock": {
"frozen": true
},
"imports": {
"@hono/hono": "jsr:@hono/hono@4.6.2",
...
}
}
{
...
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "@hono/hono/jsx"
},
"lock": {
"frozen": true
},
"imports": {
"@hono/hono": "jsr:@hono/hono@4.6.2",
...
}
}
What could be the issue? i am under the impression that deno install would install all files from all deps
7 Replies
m4rc3l05
m4rc3l05OP2mo ago
Another version of the above issue and a bit more weird i think is, i have this deno project:
{
...
"lock": {
"frozen": true
},
"imports": {
"@david/dax": "jsr:@david/dax@^0.42.0",
"@std/cli": "jsr:@std/cli@1.0.6",
"@std/path": "jsr:@std/path@^1.0.6",
"@std/yaml": "jsr:@std/yaml@1.0.5"
}
}
{
...
"lock": {
"frozen": true
},
"imports": {
"@david/dax": "jsr:@david/dax@^0.42.0",
"@std/cli": "jsr:@std/cli@1.0.6",
"@std/path": "jsr:@std/path@^1.0.6",
"@std/yaml": "jsr:@std/yaml@1.0.5"
}
}
Where if i run deno install && deno run --cached-only main.ts all goes well but if i do deno install && deno compile --cached-only main.ts i get the error
error: Specifier not found in cache: "https://jsr.io/@std/yaml/1.0.5/_type.ts", --cached-only is specified.
at https://jsr.io/@std/yaml/1.0.5/_loader_state.ts:40:37
error: Specifier not found in cache: "https://jsr.io/@std/yaml/1.0.5/_type.ts", --cached-only is specified.
at https://jsr.io/@std/yaml/1.0.5/_loader_state.ts:40:37
What could be triggering this inconsistencies? i am expecting that both deno run --cached-only and deno compile --cached only to be able to run successfully.
bartlomieju
bartlomieju2mo ago
Does it work correctly if you do deno compile without --cached-only?
cococore
cococore2mo ago
i am interesting too, to know details
m4rc3l05
m4rc3l05OP2mo ago
without --cached-only it does work, i get the downloading log and it finishes ok. it just feels weird that it has do download more stuff after a deno install has been issued, am i wrong on this assumption?
bartlomieju
bartlomieju2mo ago
It seems like a bug. A GitHub issue would be helpful here also we can fogu4e out what's wrong
m4rc3l05
m4rc3l05OP2mo ago
will do thx
m4rc3l05
m4rc3l05OP2mo ago
GitHub
deno install does not cache all dep files. · Issue #26180 · denol...
Hi, Given the following deno.json file { // ... "lock": { "frozen": true }, "imports": { "@david/dax": "jsr:@david/dax@0.42.0", "@std/cli"...