Skip to content

[🐞] Deno as package manager: production build fails #8364

@ianlet

Description

@ianlet

Which component is affected?

Qwik Runtime

Describe the bug

Description

When building a Qwik app for production under Deno (e.g. with deno task build), three issues prevent a working build out of the box.

1. qwik build CLI fails under Deno

The qwik build command fails with:

TypeError: (0 , import_node_events11.addAbortListener) is not a function

This comes from node:events.addAbortListener used by execa in packages/qwik/src/cli/utils/run-build-command.ts. Deno doesn't implement this Node API yet, so this isn't strictly a Qwik issue.

Workaround: Use deno task build.client + deno task build.server directly (the autogenerated scripts). These work because qwik check-client and vite build don't hit this code path. This leads to issues 2 and 3 below.

2. SSG static generation is a no-op stub

packages/qwik-city/src/static/deno/index.ts exits immediately:

async function generate(_opts) {
  console.error(`Deno not implemented`);
  Deno.exit(1);
}

The Node implementation (static/node) works fine under Deno's Node compatibility layer — Deno supports node:fs, node:path, node:os, and undici.

Suggested fix: Delegate to the Node implementation:

export { generate } from "../node/index";

3. Client manifest not passed to server build

In packages/qwik/src/optimizer/src/plugins/vite.ts, the temp file mechanism that passes the client manifest to the server build is gated on:

if (sys.env === 'node' || sys.env === 'bun') {

Since getEnv() returns "deno" when typeof Deno !== "undefined", this block is skipped. The result:

  • Client build never writes the manifest temp file
  • Server build never reads it
  • @qwik-client-manifest resolves to null
  • Server logs Missing client manifest and QRL serialization fails with Code(31) errors

Suggested fix: Include "deno":

if (sys.env === 'node' || sys.env === 'bun' || sys.env === 'deno') {

The node:fs and node:os APIs used in that block work under Deno's Node compat layer.

Reproduction

https://github.com/ianlet/qwik-deno-build-issues-repro

Scaffolded with deno run -A npm:create-qwik@latest empty + deno task qwik add deno on Qwik 1.19.0. See the repo README for step-by-step reproduction.

Workaround

We patch both files post-install with a Deno script before building, and use direct vite build commands instead of qwik build. Happy to submit a PR if the approach looks good.

Reproduction

https://github.com/ianlet/qwik-deno-build-issues-repro

Steps to reproduce

No response

System Info

- Qwik / Qwik City: 1.19.0
- Deno: 2.6.9
- Vite: 7.3.1

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions