Skip to content
Latchkey

Deno version mismatch between deno.json and CI in CI

When the Deno version in CI differs from what your project targets, features present locally can be missing on the runner, producing parse errors, unsupported syntax, or changed API behavior.

What this error means

Code that runs locally fails in CI with unsupported syntax, a missing API, or an import-attributes error, and deno --version in CI shows a different version than expected.

deno
deno 1.46.3 (release, x86_64-unknown-linux-gnu)
# but the project targets v2.x; syntax such as import attributes fails
error: Import assertion type "json" not supported

Common causes

setup-deno installed a different version

A floating or default deno-version in CI resolved to a version that does not match your local toolchain.

deno.json expects a version not present in CI

The project targets a Deno version (or feature set) the runner does not have, so behavior diverges.

How to fix it

Pin the Deno version explicitly

  1. Set an explicit deno-version in setup-deno matching your local version.
  2. Log deno --version to confirm.
  3. Re-run so local and CI agree.
.github/workflows/ci.yml
- uses: denoland/setup-deno@v2
  with:
    deno-version: v2.1.4

Keep the target version in deno.json

Record the expected Deno version so contributors and CI stay aligned.

deno.json
{
  "deno": "2.1.4"
}

How to prevent it

  • Pin an explicit deno-version in CI, not a floating tag.
  • Record the target Deno version in deno.json.
  • Log deno --version so mismatches are visible.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →