From 857536c28fdb1424a856f8addf16d9477449a10b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:11:20 +0000 Subject: [PATCH] fix(storage): use esm.sh bundled aws-sdk to prevent fs error Switched the CDN provider for the AWS SDK (R2 client) to the bundled version from `esm.sh` (`?bundle`). This resolves a runtime error `[unenv] fs.readFile is not implemented yet!` which occurred because the previous build was attempting to import Node.js-specific credential providers that rely on the filesystem. The bundled version from `esm.sh` correctly resolves the browser entry points and provides browser-compatible polyfills (or safe defaults) for dependencies, ensuring the SDK initializes correctly in the client environment. This change updates the `AWS_SDK_SPECIFIER` constant in `js/storage/r2-s3.js`. --- js/storage/r2-s3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/storage/r2-s3.js b/js/storage/r2-s3.js index 8435be6b..e34ed34f 100644 --- a/js/storage/r2-s3.js +++ b/js/storage/r2-s3.js @@ -1,6 +1,6 @@ // js/storage/r2-s3.js -const AWS_SDK_SPECIFIER = "https://esm.sh/@aws-sdk/client-s3@3.637.0"; +const AWS_SDK_SPECIFIER = "https://esm.sh/@aws-sdk/client-s3@3.637.0?bundle"; const disableNetworkImports = Boolean( globalThis?.__BITVID_DISABLE_NETWORK_IMPORTS__