Skip to content

Commit

Permalink
fix: ensure we pass an ArrayBufferLike to blobStore.set and not a Nod…
Browse files Browse the repository at this point in the history
…eJS Buffer
  • Loading branch information
JakeChampion authored and serhalp committed Dec 10, 2024
1 parent 7ea3e7b commit c39cb02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/build/src/plugins_core/blobs_upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ const coreStep: CoreStepFunction = async function ({
systemLog(`Uploading blob ${key}`)

const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
await blobStore.set(key, data, { metadata })
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
await blobStore.set(key, buffer.buffer, { metadata })
},
{ concurrency: 10 },
)
Expand Down
3 changes: 2 additions & 1 deletion packages/build/src/plugins_core/dev_blobs_upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const coreStep: CoreStepFunction = async function ({
log(logs, `- Uploading blob ${key}`, { indent: true })
}
const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
await blobStore.set(key, data, { metadata })
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
await blobStore.set(key, buffer.buffer, { metadata })
},
{ concurrency: 10 },
)
Expand Down

0 comments on commit c39cb02

Please sign in to comment.