diff --git a/.changeset/tall-cups-fly.md b/.changeset/tall-cups-fly.md new file mode 100644 index 00000000..ae15926b --- /dev/null +++ b/.changeset/tall-cups-fly.md @@ -0,0 +1,5 @@ +--- +"claude-dev": minor +--- + +Fix Windows path issue: Correct handling of import.meta.url to avoid leading slash in pathname diff --git a/proto/build-proto.js b/proto/build-proto.js index 4e07d1ae..dc3e55ea 100755 --- a/proto/build-proto.js +++ b/proto/build-proto.js @@ -2,6 +2,7 @@ import * as fs from "fs/promises" import * as path from "path" +import { fileURLToPath } from "url" import { execSync } from "child_process" import { globby } from "globby" import chalk from "chalk" @@ -12,7 +13,8 @@ const protoc = path.join(require.resolve("grpc-tools"), "../bin/protoc") const tsProtoPlugin = require.resolve("ts-proto/protoc-gen-ts_proto") // Get script directory and root directory -const SCRIPT_DIR = path.dirname(new URL(import.meta.url).pathname) +const __filename = fileURLToPath(import.meta.url) +const SCRIPT_DIR = path.dirname(__filename) const ROOT_DIR = path.resolve(SCRIPT_DIR, "..") async function main() {