From 50355b326a8fc6d4c6485d41a197e253b814a34c Mon Sep 17 00:00:00 2001 From: Abhinav Date: Fri, 26 Aug 2022 16:18:41 +0530 Subject: [PATCH] remove next serve util --- src/utils/next-serve.ts | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/utils/next-serve.ts diff --git a/src/utils/next-serve.ts b/src/utils/next-serve.ts deleted file mode 100644 index 3ab421547..000000000 --- a/src/utils/next-serve.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { webFrame } from 'electron'; - -// Patch the global WebSocket constructor to use the correct DevServer url -export const fixHotReloadNext12 = () => { - webFrame.executeJavaScript(`Object.defineProperty(globalThis, 'WebSocket', { - value: new Proxy(WebSocket, { - construct: (Target, [url, protocols]) => { - if (url.endsWith('/_next/webpack-hmr')) { - // Fix the Next.js hmr client url - return new Target("ws://localhost:3000/_next/webpack-hmr", protocols) - } else { - return new Target(url, protocols) - } - } - }) - });`); -};