Skip to content

fix(cloudflare): use pathe for POSIX relative paths in wrangler.json (v2) - #4801

Open
lx3133584 wants to merge 1 commit into
nitrojs:v2from
lx3133584:fix/cloudflare-wrangler-windows-relative-path
Open

lx3133584 wants to merge 1 commit into
nitrojs:v2from
lx3133584:fix/cloudflare-wrangler-windows-relative-path

Conversation

@lx3133584

Copy link
Copy Markdown

Description

Follow-up to #4793 / commit 50fb1a1.

In src/presets/cloudflare/utils.ts, relative, dirname, and extname were imported from Node's built-in node:path. On Windows, node:path.relative(...) emits Windows-style backslashes (e.g. ..\public instead of ../public).

This caused the newly added unit tests in test/unit/cloudflare-config.test.ts to fail on Windows CI with:

AssertionError: expected '..\public' to be '../public' // Object.is equality
Expected: "../public"
Received: "..\public"
 ❯ test/unit/cloudflare-config.test.ts:151:44

Wrangler configurations require normalized POSIX paths across all operating systems.

Changes

  • In src/presets/cloudflare/utils.ts, replace import { relative, dirname, extname } from "node:path" with imports from pathe (dirname, extname, join, relative, resolve). pathe guarantees normalized forward-slash paths on all platforms.
  • In test/unit/cloudflare-config.test.ts, assert generated.assets.directory does not contain backslashes.

Verification

  • vitest run test/unit/cloudflare-config.test.ts passed (16 tests).
  • vitest run test/unit/ passed (all 17 suites, 99 tests).
  • unbuild succeeded.
  • eslint and prettier -c passed with 0 errors.

🤖 Generated with Claude Code

…(v2)

Co-Authored-By: Claude Code <noreply@anthropic.com>
@lx3133584
lx3133584 requested a review from pi0 as a code owner October 15, 2026 22:32
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@lx3133584 is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e9097d2-5d53-4473-b451-66123668bf86

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitropack@4801

commit: 26fffe8

This branch has not been deployed

No deployments
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.

1 participant