Skip to main content
← Back to list
01Issue
BugTriagedSwamp CLITeam
Assigneesstack72

Relationships

Blocked

#1324 Bundled extension model cannot deserialize AWS SDK S3 XML that works in direct Deno

Opened by evrardjp · 7/21/2026

Problem

A model extension importing npm:@aws-sdk/client-s3@3.1091.0 fails to deserialize valid S3 XML when executed by swamp, while the identical client and request succeed under direct Deno 2.8.3.

Environment

  • Swamp 20260720.221015.0-sha.472127ff
  • Deno 2.8.3
  • AWS SDK npm:@aws-sdk/client-s3@3.1091.0
  • Floci floci/floci:1.5.11 S3 endpoint

Reproduction

  1. Start Floci on http://[IP-1]:4566.
  2. Run a direct Deno S3Client with endpoint override, static test credentials, us-east-1, and forcePathStyle: true; ListBuckets and CreateBucket succeed.
  3. Put the same client calls in a minimal swamp model extension, add it as an extension source, create a model, and run the method.

Actual

Both operations fail only in the bundled model runtime with:

@aws-sdk XML parse error: unexpected content.
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.

The raw ListBuckets response is HTTP 200, content-type: application/xml;charset=UTF-8, and valid AWS S3 XML. The same package version parses it correctly in direct Deno.

Expected

An npm AWS SDK client bundled as part of a swamp extension should deserialize the same HTTP response identically to the same import executed directly by Deno.

A complete local reproduction and workaround are retained in evrardjp/swamp-extensions/floci-aws/issue-drafts/swamp-extension-aws-sdk-bundling.md.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW

Triaged

7/24/2026, 7:23:29 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/24/2026, 7:18:15 PM
stack72 marked as blocked7/24/2026, 8:29:03 PM
Editable. Press Enter to edit.

stack72 commented 7/24/2026, 8:21:40 PM

Hey @evrardjp — thanks for the detailed report. We've been triaging this and attempting to reproduce the XML deserialization failure, but haven't been able to trigger it yet. Here's what we tried:

  1. Bundled a minimal extension importing npm:@aws-sdk/client-s3@3.1091.0 using the same deno bundle --platform deno flags swamp uses
  2. Inspected the generated bundle — CJS/ESM interop looks correct (__toESM already resolves to always setting .default in Deno 2.8.3's esbuild)
  3. Imported the bundle (both with and without swamp's fixCjsEsmInterop + rewriteZodImports post-processing) and called ListBucketsCommand against a mock S3 server returning valid AWS XML
  4. XML deserialization succeeded in all cases

Could you help us narrow this down with a few details?

  • Debug logs: Can you run the failing swamp command with SWAMP_DEBUG=1 and share the output? That will show which bundle import path is being used and any errors that might be silently swallowed.
  • Raw XML response: Could you share the exact XML body that Floci returns for ListBuckets? (You mentioned the raw response is HTTP 200 with valid XML — if there's a BOM, encoding quirk, or content-type difference, that might explain why our mock doesn't reproduce it.)
  • Compiled vs dev: Are you running the compiled swamp binary or deno run dev? We want to check whether the compiled binary's module resolution behaves differently.
  • Extension loading: When you run swamp model type list, does your extension type show up, or do you see a "broken bundles" warning?

Any of these would help us pinpoint whether this is a bundler issue, a Floci-specific XML shape, or something in the compiled binary's runtime.

stack72 commented 7/29/2026, 4:56:16 PM

@evrardjp ping to put this back on your radar

evrardjp commented 7/30/2026, 12:12:08 PM

I did not forget it :)

I just did not have time recently. Probably only next tuesday :/

stack72 commented 7/30/2026, 9:42:16 PM

Not a worry!! Understood on you being busy

evrardjp commented 8/4/2026, 4:19:20 PM(edited)

still not worked on it, will ping you when I have the time, this has been low prio fo rme.

I ran swamp binary (not deno run dev). I did not see broken bundles (for this at least). For the rest, I will have to rework on it.

Sign in to post a ripple.