fix: add __dirname polyfill for ES modules
- Import fileURLToPath from node:url - Define __dirname using import.meta.url for ES module compatibility - Fixes ReferenceError when serving static files in production Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
8e1f5adaa4
commit
70931576dc
@@ -1,6 +1,7 @@
|
||||
import fs from "node:fs";
|
||||
import http from "node:http";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { Streamer } from "@dank074/discord-video-stream";
|
||||
import { AudioPlayerStatus } from "@discordjs/voice";
|
||||
import type { Client } from "discord.js-selfbot-v13";
|
||||
@@ -25,6 +26,9 @@ import { createUIStateRoutes } from "./routes/uiStateRoutes";
|
||||
import { createVoiceRoutes } from "./routes/voiceRoutes";
|
||||
import type { VoiceController } from "./voiceController";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const wsLogger = createChildLogger("webserver");
|
||||
|
||||
const activeUsers = new Map<
|
||||
|
||||
Reference in New Issue
Block a user