Skip to content

Commit ee52833

Browse files
committed
fix: ensure we pass an ArrayBufferLike to blobStore.set and not a NodeJS Buffer
1 parent ef92c48 commit ee52833

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/build/src/plugins_core/blobs_upload/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const coreStep: CoreStepFunction = async function ({
7272
systemLog(`Uploading blob ${key}`)
7373

7474
const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
75-
await blobStore.set(key, data, { metadata })
75+
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
76+
await blobStore.set(key, buffer.buffer, { metadata })
7677
},
7778
{ concurrency: 10 },
7879
)

packages/build/src/plugins_core/dev_blobs_upload/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ const coreStep: CoreStepFunction = async function ({
7777
log(logs, `- Uploading blob ${key}`, { indent: true })
7878
}
7979
const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
80-
await blobStore.set(key, data, { metadata })
80+
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
81+
await blobStore.set(key, buffer.buffer, { metadata })
8182
},
8283
{ concurrency: 10 },
8384
)

0 commit comments

Comments
 (0)