Skip to content

Commit 3b46db6

Browse files
committed
fix: rearrange variable to access after initializing
1 parent 8916c01 commit 3b46db6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/webapp/app/v3/handleWebsockets.server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import { AuthenticatedSocketConnection } from "./authenticatedSocketConnection.s
77
import { Gauge } from "prom-client";
88
import { metricsRegister } from "~/metrics.server";
99

10-
export const wss = singleton("wss", initalizeWebSocketServer);
11-
10+
// Moved in front of export const wss because
11+
// ReferenceError: Cannot access 'authenticatedConnections' before initialization
1212
let authenticatedConnections: Map<string, AuthenticatedSocketConnection>;
1313

14+
export const wss = singleton("wss", initalizeWebSocketServer);
15+
1416
function initalizeWebSocketServer() {
1517
const server = new WebSocketServer({ noServer: true });
1618

0 commit comments

Comments
 (0)