From e11810ae5d569e5d8d727526e9a8139bbb30dbf4 Mon Sep 17 00:00:00 2001 From: hazre Date: Sun, 19 Apr 2026 13:50:36 +0200 Subject: [PATCH] fix: remove invalid global polyfill --- src/client/initMatrix.ts | 6 +++--- vite.config.ts | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/client/initMatrix.ts b/src/client/initMatrix.ts index 88bab74d9..134de49bb 100644 --- a/src/client/initMatrix.ts +++ b/src/client/initMatrix.ts @@ -275,12 +275,12 @@ const buildClient = async (session: Session): Promise => { const storeName = getSessionStoreName(session); const indexedDBStore = new IndexedDBStore({ - indexedDB: global.indexedDB, - localStorage: global.localStorage, + indexedDB: globalThis.indexedDB, + localStorage: globalThis.localStorage, dbName: storeName.sync, }); - const legacyCryptoStore = new IndexedDBCryptoStore(global.indexedDB, storeName.crypto); + const legacyCryptoStore = new IndexedDBCryptoStore(globalThis.indexedDB, storeName.crypto); const mx = createClient({ baseUrl: session.baseUrl, diff --git a/vite.config.ts b/vite.config.ts index 92a95ac6e..2b01a9a1c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,6 @@ import svgr from 'vite-plugin-svgr'; import { wasm } from '@rollup/plugin-wasm'; import { viteStaticCopy } from 'vite-plugin-static-copy'; import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; -import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'; import * as injectModule from '@rollup/plugin-inject'; import * as topLevelAwaitModule from 'vite-plugin-top-level-await'; import type { Options as TopLevelAwaitOptions } from 'vite-plugin-top-level-await'; @@ -220,18 +219,6 @@ export default defineConfig(({ command }) => ({ '@vanilla-extract/recipes/createRuntimeFn', ], needsInterop: ['matrix-widget-api'], - rolldownOptions: { - define: { - global: 'globalThis', - }, - plugins: [ - // Enable esbuild polyfill plugins - NodeGlobalsPolyfillPlugin({ - process: false, - buffer: true, - }), - ], - }, }, build: { outDir: 'dist',