Deno "Import assertion type not supported" in CI
Deno rejected an import assertion because the syntax or type is not supported by the Deno version on the runner. Import assertion syntax moved to import attributes (with), so an older or mismatched runtime can fail.
What this error means
The run fails with "error: Import assertion type \"json\" not supported" or a parse error on assert { type: "json" } / with { type: "json" }.
error: Import assertion type "json" not supported
at file:///home/runner/work/app/app/src/config.ts:1:30Common causes
A Deno version mismatch between local and CI
The syntax works on your local Deno but the CI runner has a different version that expects the other spelling (assert vs with).
Using the deprecated assert keyword
Newer Deno expects import attributes with with { type: "json" }; the older assert { type: "json" } may not be accepted.
How to fix it
Use import attributes with the with keyword
- Update the import to the attribute syntax supported by your Deno version.
- Re-run to confirm the assertion is accepted.
import config from "./config.json" with { type: "json" };Pin the Deno version in CI
Match the runner Deno to the version that supports your syntax so local and CI agree.
- uses: denoland/setup-deno@v2
with:
deno-version: v2.xHow to prevent it
- Standardize on the import attributes
withsyntax. - Pin the Deno version in CI to match local development.
- Run
deno --versionin CI to log the exact runtime.