diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 71b03fd..b23b4da 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -17,7 +17,7 @@ const monacoEditorPlugin = isObjectWithDefaultFunction(monacoEditorPluginModule) // Win7 build: bundle all deps (Vite converts ESM→CJS), only externalize native modules const isLegacyBuild = process.env.LEGACY_BUILD === 'true' -const legacyExternal = ['sysproxy-rs', 'electron'] +const legacyExternal = ['sysproxy-rs', 'electron', 'utf-8-validate', 'bufferutil'] export default defineConfig({ main: { diff --git a/src/main/config/profile.ts b/src/main/config/profile.ts index 5761359..fd91204 100644 --- a/src/main/config/profile.ts +++ b/src/main/config/profile.ts @@ -28,7 +28,7 @@ export async function getProfileConfig(force = false): Promise { } if (typeof profileConfig !== 'object') profileConfig = { items: [] } if (!Array.isArray(profileConfig.items)) profileConfig.items = [] - return structuredClone(profileConfig) + return JSON.parse(JSON.stringify(profileConfig)) } export async function setProfileConfig(config: IProfileConfig): Promise { @@ -48,12 +48,12 @@ export async function updateProfileConfig( profileConfig = parse(data) || { items: [] } if (typeof profileConfig !== 'object') profileConfig = { items: [] } if (!Array.isArray(profileConfig.items)) profileConfig.items = [] - profileConfig = await updater(structuredClone(profileConfig)) + profileConfig = await updater(JSON.parse(JSON.stringify(profileConfig))) result = profileConfig await writeFile(profileConfigPath(), stringify(profileConfig), 'utf-8') }) await profileConfigWriteQueue - return structuredClone(result ?? profileConfig) + return JSON.parse(JSON.stringify(result ?? profileConfig)) } export async function getProfileItem(id: string | undefined): Promise {