Skip to content

Web app: S3 sync fails with TypeError: can't access property "getReader" #15601

@avargaskun

Description

@avargaskun

Operating system

macOS

Joplin version

Web app (app.joplincloud.com), accessed 2026-06-03. Bundled @aws-sdk/client-s3 is 3.296.0

Desktop version info

No response

Current behaviour

Firefox version: 151.0.3 (aarch64)

S3 sync in the web app fails with:

Synchronizer: TypeError: can't access property "getReader", e is null

In the network inspector, all HEAD requests to the S3 bucket succeed (2xx), but the sync aborts before any new remote content is downloaded (no GET requests for changed items).

Steps to reproduce:

  1. Configure S3 sync in the web app (AWS S3, previously working configuration; desktop/mobile clients sync fine against the same bucket).
  2. Trigger a sync in Firefox.
  3. Sync fails with the TypeError above as soon as the synchronizer stats remote items via HeadObject.

Root cause:
This is a known bug in AWS SDK JS v3 prior to v3.329.0: aws/aws-sdk-js-v3#4398. In browsers, fetch() returns Response.body === null for HEAD responses. The HeadObject deserializer in older SDK versions unconditionally calls collectBody(output.body) -> streamCollector -> body.getReader(), throwing this TypeError. The fix shipped in @aws-sdk v3.329.0 (fetch-http-handler now tolerates a null body), but Joplin pins @aws-sdk/client-s3 at 3.296.0.

Confirmed in the browser console on app.joplincloud.com:

fetch(location.href, { method: 'HEAD' }).then(r => console.log(r.body)); // logs null

Expected behaviour

S3 sync completes in the web app.

Bumping @aws-sdk/client-s3 to >= 3.329.0 resolves this.

Logs

Stack trace (Firefox, app.bundle.js):

Synchronizer: TypeError: can't access property "getReader", e is null
    streamCollector
    deserializeAws_restXmlHeadObjectCommand
    deserializerMiddleware
    awsAuthMiddleware
    retryMiddleware
    userAgentMiddleware
    recursionDetectionMiddleware
    hostHeaderMiddleware

(Full minified trace available on request; every frame resolves to app.bundle.js.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIt's a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions