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.11S3 endpoint
Reproduction
- Start Floci on
http://[IP-1]:4566. - Run a direct Deno
S3Clientwith endpoint override, static test credentials,us-east-1, andforcePathStyle: true;ListBucketsandCreateBucketsucceed. - 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.
Closed
No activity in this phase yet.
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:
- Bundled a minimal extension importing
npm:@aws-sdk/client-s3@3.1091.0using the samedeno bundle --platform denoflags swamp uses - Inspected the generated bundle — CJS/ESM interop looks correct (
__toESMalready resolves to always setting.defaultin Deno 2.8.3's esbuild) - Imported the bundle (both with and without swamp's
fixCjsEsmInterop+rewriteZodImportspost-processing) and calledListBucketsCommandagainst a mock S3 server returning valid AWS XML - 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=1and 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.
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.
stack72 commented 8/12/2026, 7:02:32 PM
I am going to close this out - when you have some bw to try it then let me know and we can try this again
Sign in to post a ripple.