this repo has no description
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(indexer): override nodeModulesDir to auto in worker container

deno.json globally sets "nodeModulesDir": "manual" because the Fresh
app deploys with a package.json + npm install workflow on Deno Deploy.
The indexer worker has no package.json, so 'manual' mode left
node_modules empty and the runtime crashed with ERR_MODULE_NOT_FOUND
on @libsql/client/web.

Pass --node-modules-dir=auto on both the build-time 'deno cache' and
the runtime 'deno run' so Deno itself populates and uses node_modules,
independent of the project default. The Fresh build is unaffected.

Made-with: Cursor

+12 -8
+12 -8
worker.Dockerfile
··· 18 18 COPY lexicons ./lexicons 19 19 COPY utils.ts ./utils.ts 20 20 21 - # `deno.json` declares `"nodeModulesDir": "manual"`, so Deno expects an 22 - # actual ./node_modules to exist when resolving npm: specifiers (e.g. 23 - # @libsql/client/web). `deno install` materializes node_modules from the 24 - # lockfile without running lifecycle scripts. We then `deno cache` the 25 - # entrypoint so all JSR/HTTPS imports are pre-fetched into the global 26 - # cache and the container can start fully offline. 27 - RUN deno install && deno cache worker/indexer.ts 21 + # `deno.json` declares `"nodeModulesDir": "manual"` (which assumes a 22 + # package.json + npm/pnpm install workflow). The indexer doesn't ship a 23 + # package.json — we lay down npm packages straight from deno.json's 24 + # `imports` map by passing `--node-modules-dir=auto` to every Deno 25 + # command. That overrides the project setting for the duration of the 26 + # command and lets Deno create + populate ./node_modules itself. 27 + # 28 + # Same flag at build time (cache) and runtime (run); without it at 29 + # runtime, Deno re-checks `nodeModulesDir: manual` and refuses to use 30 + # the node_modules we just created. 31 + RUN deno cache --node-modules-dir=auto worker/indexer.ts 28 32 29 33 ENV DENO_ENV=production 30 34 31 35 # -A grants the network/env/read perms the indexer needs (WebSocket to 32 36 # Jetstream, HTTPS to PDSes, env vars for DB creds, file: DB in dev). 33 - CMD ["deno", "run", "-A", "worker/indexer.ts"] 37 + CMD ["deno", "run", "-A", "--node-modules-dir=auto", "worker/indexer.ts"]