Skip to content

🐛 fix(#7697): use correct working directory for Deno environment#7699

Merged
gioboa merged 2 commits intoQwikDev:mainfrom
siguici:fix-deno
Jun 30, 2025
Merged

🐛 fix(#7697): use correct working directory for Deno environment#7699
gioboa merged 2 commits intoQwikDev:mainfrom
siguici:fix-deno

Conversation

@siguici
Copy link
Member

@siguici siguici commented Jun 30, 2025

What is it?

  • Bug

Description

When building a Qwik project using Deno, the process fails because the Vite build.outDir is resolved to an absolute path (/dist) rather than a relative one. This happens because the optimizer currently sets cwd() to '/' by default for platforms other than Node.js and Bun (source).

This causes Deno to attempt writing to the system root directory, which typically fails with a permission error (EACCES). This does not occur in Node or Bun environments, where cwd() resolves to process.cwd().

In this PR, we fix the issue by using Deno.cwd() as the default cwd() value when the runtime environment is Deno.

It’s also worth noting that this cwd() is used to compute the rootDir, which influences Vite’s outDir (see reference).

Related Issue

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

@siguici siguici requested a review from a team as a code owner June 30, 2025 10:16
@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: 0c4aeae

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

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city 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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 30, 2025

Open in StackBlitz

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

commit: 7053fb9

@github-actions
Copy link
Contributor

github-actions bot commented Jun 30, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 0c4aeae

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Thanks for your help @siguici
It looks great to me 🎉

@gioboa gioboa linked an issue Jun 30, 2025 that may be closed by this pull request
@gioboa gioboa changed the title 🐛 Fix(#7697): Use correct working directory for Deno environment 🐛 fix(#7697): use correct working directory for Deno environment Jun 30, 2025
@gioboa gioboa merged commit ce0876a into QwikDev:main Jun 30, 2025
18 checks passed
@github-actions github-actions bot mentioned this pull request Jul 16, 2025
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 fails to build Qwik app due to absolute outDir (/dist) path

2 participants