Azure Key Vault extension vault bundle fails to load in compiled binary
Opened by swampadmin · 11/22/2025
Description
The @swamp/azure-kv vault extension bundle fails to load when running inside the compiled swamp binary. The bundle is successfully downloaded and installed by the auto-resolver, but the UserVaultLoader fails to import it.
The Azure SDK dependencies (@azure/identity, @azure/keyvault-secrets) produce a very large bundle when inlined by deno bundle. When the compiled binary tries to import this bundle, it falls back to the base64 data URL import path (data:application/javascript;base64,...), which fails with:
The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received data:application/javascript;base64,...The @swamp/1password (no npm SDK deps) and @swamp/aws-sm (AWS SDK) extensions load successfully. The Azure bundle is significantly larger due to the combined @azure/identity + @azure/keyvault-secrets dependency tree.
Steps to reproduce
- Compile swamp:
deno run compile - Initialize a repo:
swamp repo init(in a fresh directory) - Create
extensions/models/directory (required for install) - Create a vault config YAML with
type: azure-kv - Run any vault command (e.g.,
swamp vault list-keys <name>) - Auto-resolution finds and installs
@swamp/azure-kvsuccessfully - The vault bundle file exists at
.swamp/vault-bundles/azure_kv.js - Loading the bundle fails with the data URL error
Environment
- macOS (darwin-aarch64)
- Compiled binary via
deno run compile
Summary
This affects the UserVaultLoader.importBundle() method in src/domain/vaults/user_vault_loader.ts. The file URL import path should work since the bundle is written to .swamp/vault-bundles/azure_kv.js, but it appears to fall through to the data URL fallback. The fix likely involves ensuring the file URL import path is used when the cached bundle file exists on disk, and investigating why it falls through to the data URL path for large bundles. The uint8ArrayToBase64 chunked encoding (added in PR #731 for large model bundles) may also need to be verified for vault bundles.
Closed
No activity in this phase yet.
Sign in to post a ripple.