Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

build: ignore AbortController when in node

Alaister Young8ad6e7806d3a
diff --git a/studio/localStores/storageExplorer/StorageExplorerStore.js b/studio/localStores/storageExplorer/StorageExplorerStore.js
index 202ce43bfd6..5729059eb6d 100644
--- a/studio/localStores/storageExplorer/StorageExplorerStore.js
+++ b/studio/localStores/storageExplorer/StorageExplorerStore.js
@@ -65,7 +65,11 @@ class StorageExplorerStore {
selectedItemsToMove = []
selectedFilePreview = {}
- DEFAULT_OPTIONS = { limit: LIMIT, offset: OFFSET, sortBy: { column: this.sortBy, order: this.sortByOrder } }
+ DEFAULT_OPTIONS = {
+ limit: LIMIT,
+ offset: OFFSET,
+ sortBy: { column: this.sortBy, order: this.sortByOrder },
+ }
/* Supabase client */
supabaseClient = null
@@ -87,7 +91,11 @@ class StorageExplorerStore {
constructor(projectRef) {
makeAutoObservable(this, { supabaseClient: false })
this.projectRef = projectRef
- this.abortController = new AbortController()
+
+ // ignore when in a non-browser environment
+ if (typeof window !== 'undefined') {
+ this.abortController = new AbortController()
+ }
}
initStore(projectRef, url, serviceKey) {
@@ -1182,7 +1190,11 @@ class StorageExplorerStore {
formattedPathToFolder = `${prefix}/${name}`
}
- const options = { limit: LIMIT, offset: OFFSET, sortBy: { column: this.sortBy, order: this.sortByOrder } }
+ const options = {
+ limit: LIMIT,
+ offset: OFFSET,
+ sortBy: { column: this.sortBy, order: this.sortByOrder },
+ }
const { data: folderContents } = await this.supabaseClient.storage
.from(this.selectedBucket.name)
.list(formattedPathToFolder, options)