deno2nix icon indicating copy to clipboard operation
deno2nix copied to clipboard

Hash mismatch for esm.sh dependencies?

Open abustany opened this issue 2 years ago • 3 comments

Revision: 53adb67

Flake snippet:

        packages.uploader = pkgs.deno2nix.mkExecutable {
          pname = "uploader";
          version = self.rev;

          src = ./.;
          bin = "uploader";
          lockfile = "./deno.lock";
          config = "./deno.json";
          entrypoint = "./uploader.ts";

          allow = {
            all = true;
          };
        };

Imports in the code:

// @deno-types="./dcmjs.d.ts"
import dcmjs from "https://esm.sh/[email protected]";

Output:

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'uploader-a396ad10ace1db0742491a00c09e2ebf0492990e'
         whose name attribute is located at /nix/store/2ja7y9nhrck3ydp9bj2234hcid0sx7qg-source/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'buildPhase' of derivation 'uploader-a396ad10ace1db0742491a00c09e2ebf0492990e'

         at /nix/store/n5qyjg02vv11842wg394andkips3b6dp-source/nix/mk-executable.nix:62:5:

           61|     buildInputs = with pkgs; [deno jq];
           62|     buildPhase = ''
             |     ^
           63|       export DENO_DIR="/tmp/deno2nix"

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: hash mismatch in file downloaded from 'https://esm.sh/[email protected]':
         specified: sha256:0w14lnwghk2mlmxqr3ph48wxd9igy9ri0ychqxj0bmzjd207bz8q
         got:       sha256:1ccgp70zn7id4x5j37n1hwlx5hvjr1w22i33wmgr2camcsb709lf

abustany avatar May 17 '23 16:05 abustany

Here are the relevant entries in deno.lock:

    "https://esm.sh/[email protected]": "18fd758068f2d70564c790791073f22fa6d63922f08e8c7ba5554cf8b8a52470",
    "https://esm.sh/v120/[email protected]/deno/dcmjs.mjs": "63d7d710335da06c486b60085b0116324b7831a1a3ab542db3acced26faba222"

abustany avatar May 17 '23 16:05 abustany

Got the same issue. Any insights / clues ?

hsjobeki avatar Jun 22 '23 12:06 hsjobeki

Fairly sure this is caused by #6. There is more discussion in #27.

milibopp avatar Oct 17 '23 20:10 milibopp