hcode
hcode

Reputation: 15

Issue deploying a Deno Fresh app using new ahead-of-time builds and GitHub actions

I'm trying to deploy my Fresh app using the new ahead-of-time builds to pre-optimize static assets. I've followed the instructions on the docs site and it works just fine locally.

However, when trying to deploy on Deno Deploy, the deploy workflow fails on the Build step (when running deno task build).

The reason is the following error:

error: The source code is invalid, as it does not match the expected hash in the lock file. Specifier: https://esm.sh/[email protected]/debug.

I've been doing some research, and it seems that esm.sh import preact dependencies using different build versions which in turn fails integrity check, and the proposed solution is pinning the versions on deno.json, however, it doesn't work for me or, maybe I'm doing something wrong.

Here is the relevant part of my deno.json file imports:

"imports": {
  "preact": "https://esm.sh/[email protected]?pin=v122",
  "preact/": "https://esm.sh/[email protected]/",
  "preact-render-to-string": "https://esm.sh/*[email protected]?pin=v122",
  "@preact/signals": "https://esm.sh/*@preact/[email protected]",
  "@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
}

This is the build task command:

deno run -A dev.ts build --lock=deno.lock --lock-write

Any ideas how to solve this?

Upvotes: 0

Views: 443

Answers (1)

PK_info
PK_info

Reputation: 87

I just ran into the same issue. I deleted the lockfile and restarted the service to generate a new lock file.

Upvotes: 0

Related Questions