Skip to main content
← Back to list
01Issue
BugClosedSwamp Club
AssigneesNone

Azure Key Vault extension vault bundle fails to load in compiled binary

Opened by swampadmin · 11/1/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

  1. Compile swamp: deno run compile
  2. Initialize a repo: swamp repo init (in a fresh directory)
  3. Create extensions/models/ directory (required for install)
  4. Create a vault config YAML with type: azure-kv
  5. Run any vault command (e.g., swamp vault list-keys <name>)
  6. Auto-resolution finds and installs @swamp/azure-kv successfully
  7. The vault bundle file exists at .swamp/vault-bundles/azure_kv.js
  8. 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.

02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.