Skip to content

fix(qwik-city): support Deno as package manager for production builds#8385

Merged
wmertens merged 2 commits intoQwikDev:mainfrom
ianlet:fix/deno-production-builds
Feb 28, 2026
Merged

fix(qwik-city): support Deno as package manager for production builds#8385
wmertens merged 2 commits intoQwikDev:mainfrom
ianlet:fix/deno-production-builds

Conversation

@ianlet
Copy link
Contributor

@ianlet ianlet commented Feb 25, 2026

Summary

Fixes #8364. When using Deno to manage dependencies and run builds (deno task build.client + deno task build.server), two issues prevented a working production build:

  1. Client manifest not passed to server build — The Vite plugin's temp file mechanism was gated on node/bun only, so Deno builds got null manifests and Code(31) errors.
  2. SSG stubbed out — The Deno SSG entry called Deno.exit(1) instead of delegating to the Node implementation, which works under Deno's Node compatibility layer.

Changes

  • Extract hasNodeCompat() predicate to include deno in all 4 env gates in the Vite plugin (vite.ts)
  • Route Deno to the Node SSG module at runtime, same as Bun (static/index.ts)
  • Remove dead static/deno/ stub and its build step (scripts/qwik-city.ts)

Test plan

  • Unit tests pass (pnpm test.unit) — 771 tests, including 2 new Deno-specific tests
  • pnpm build --qwik --qwikcity --dev succeeds
  • Validated end-to-end with a Deno project: client build writes manifest, server build reads it, SSG runs successfully — all without patches

When using Deno to manage dependencies and run builds (e.g.
`deno task build.client` + `deno task build.server`), two issues
prevented a working production build:

1. The Vite plugin's temp file mechanism for passing the client
   manifest to the server build was gated on node/bun only, so
   Deno builds got null manifests and Code(31) errors.

2. SSG static generation stubbed out with Deno.exit(1) instead of
   delegating to the Node implementation, which works under Deno's
   Node compatibility layer.

- Extract `hasNodeCompat()` predicate to include deno in all 4 env
  gates in the Vite plugin
- Route Deno to the Node SSG module at runtime (same as Bun)
- Remove dead static/deno stub and its build step

Closes QwikDev#8364

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ianlet ianlet requested a review from a team as a code owner February 25, 2026 01:05
@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

🦋 Changeset detected

Latest commit: 0314b61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@builder.io/qwik Patch
@builder.io/qwik-city Patch
eslint-plugin-qwik Patch
@builder.io/qwik-react Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@promptless-for-oss
Copy link

@ianlet ✅ Promptless drafted a docs update: #8386

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@builder.io/qwik@8385
npm i https://pkg.pr.new/@builder.io/qwik-city@8385
npm i https://pkg.pr.new/eslint-plugin-qwik@8385
npm i https://pkg.pr.new/create-qwik@8385

commit: 0314b61

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 0314b61

@shairez
Copy link
Contributor

shairez commented Feb 27, 2026

@ianlet do you know what this promptless app is by any chance?
It started commenting on our PRs after this PR was created

@ianlet
Copy link
Contributor Author

ianlet commented Feb 27, 2026

@shairez nope, no idea. I wrote to you about it in private.

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but in v2 this code has seen some changes and I won't try to port it.

So I'm ok with merging if you first create a PR to add this for v2 @ianlet ?

@ianlet
Copy link
Contributor Author

ianlet commented Feb 28, 2026

@wmertens will do 🫡

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Qwik City production builds when dependencies/builds are run under Deno by treating Deno as Node-compatible for the Vite manifest handoff and by routing Deno SSG to the existing Node implementation.

Changes:

  • Update the Qwik Vite plugin to consider deno a Node-compatible environment for temp-manifest read/write logic.
  • Make @builder.io/qwik-city/static resolve Deno to the Node SSG entry module (same behavior as Bun).
  • Remove the unused Deno SSG stub and its build step, and add Deno-focused unit coverage for the Vite plugin config behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/qwik-city.ts Removes the build step for the deleted Deno SSG stub bundle.
packages/qwik/src/optimizer/src/plugins/vite.unit.ts Adds Deno-specific unit tests and enables mocking sys.env as deno.
packages/qwik/src/optimizer/src/plugins/vite.ts Centralizes Node-compat detection and includes deno in manifest-passing and vendor-scan env gates.
packages/qwik-city/src/static/index.ts Routes Deno SSG to the Node entry module instead of a Deno-specific bundle.
packages/qwik-city/src/static/deno/index.ts Deletes the previous stub implementation that exited with failure.
.changeset/deno-production-builds.md Adds a changeset documenting the Deno production build fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wmertens wmertens merged commit e2ff04a into QwikDev:main Feb 28, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐞] Deno as package manager: production build fails

5 participants