Skip to content

Commit 70cc437

Browse files
authored
[ISSUE-3145] Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname (RooCodeInc#3237)
* [ISSUE-3145] Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname * Add changeset file
1 parent bdfda6f commit 70cc437

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/tall-cups-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname

proto/build-proto.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as fs from "fs/promises"
44
import * as path from "path"
5+
import { fileURLToPath } from "url"
56
import { execSync } from "child_process"
67
import { globby } from "globby"
78
import chalk from "chalk"
@@ -12,7 +13,8 @@ const protoc = path.join(require.resolve("grpc-tools"), "../bin/protoc")
1213
const tsProtoPlugin = require.resolve("ts-proto/protoc-gen-ts_proto")
1314

1415
// Get script directory and root directory
15-
const SCRIPT_DIR = path.dirname(new URL(import.meta.url).pathname)
16+
const __filename = fileURLToPath(import.meta.url)
17+
const SCRIPT_DIR = path.dirname(__filename)
1618
const ROOT_DIR = path.resolve(SCRIPT_DIR, "..")
1719

1820
async function main() {

0 commit comments

Comments
 (0)