Skip to content

Commit f268ffb

Browse files
authored
fix(ui): resolve Windows path generation bug in openapi-ts resulting in ENOENT errors (#15056)
1 parent 856ce5c commit f268ffb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/openapi-ts.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type {UserConfig} from "@hey-api/openapi-ts";
22
// @ts-expect-error need a second tsconfig file for node execution (vite.config, openapi-ts.config, vitest.config)
33
import * as path from "path";
4+
import {fileURLToPath} from "url";
45
import {defineKestraHeyConfig} from "./heyapi-sdk-plugin";
56

6-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
79

810
const generateHash = (str: string) => {
911
let hash = 0;

0 commit comments

Comments
 (0)