We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbaf756 commit 9205440Copy full SHA for 9205440
packages/socket/src/reconnectingsocket.spec.ts
@@ -3,7 +3,13 @@ import { ReconnectingSocket } from "./reconnectingsocket";
3
/** @see https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback */
4
type Exec = (command: string, callback: (error: null | (Error & { readonly code?: number })) => void) => void;
5
6
-const getExec = async (): Promise<Exec | undefined> => (await import("child_process")).exec;
+const getExec = async (): Promise<Exec | undefined> => {
7
+ try {
8
+ return (await import("child_process")).exec;
9
+ } catch {
10
+ return undefined;
11
+ }
12
+};
13
14
function pendingWithoutSocketServer(): void {
15
if (typeof process !== "undefined" && process?.env.SOCKETSERVER_ENABLED) {
0 commit comments