juspay/hyperswitch · error

Failed to read SDK config file '{}': {}

Error message

Failed to read SDK config file '{}': {}

What it means

Error "Failed to read SDK config file '{}': {}" thrown in juspay/hyperswitch.

Source

Thrown at crates/payment_link/build.rs:29

        .unwrap_or_else(|| {
            #[cfg(debug_assertions)]
            let default = Env::Development;
            #[cfg(not(debug_assertions))]
            let default = Env::Production;
            default
        });

    // Use the payment_link specific SDK URL configuration
    let sdk_config_path = "config/sdk_urls.toml";

    // Tell cargo to rerun if config file changes
    println!("cargo:rerun-if-changed={}", sdk_config_path);
    println!("cargo:rerun-if-env-changed=ENVIRONMENT");

    // Read and parse SDK URLs TOML file
    #[allow(clippy::panic)]
    let config_content = fs::read_to_string(sdk_config_path).unwrap_or_else(|e| {
        panic!(
            "Failed to read SDK config file '{}': {}",
            sdk_config_path, e
        );
    });

    #[allow(clippy::panic)]
    let config: HashMap<Env, EnvConfig> = toml::from_str(&config_content).unwrap_or_else(|e| {
        panic!("Failed to parse TOML in '{}': {}", sdk_config_path, e);
    });

    // Extract SDK URL for the current environment
    #[allow(clippy::panic)]
    let sdk_url = config
        .get(&environment)
        .map(|c| c.sdk_url.as_str())
        .unwrap_or_else(|| {
            panic!(
                "Missing [{}] section in config file: {}",

View on GitHub (pinned to 705a321950)

Solutions

  1. Ensure the SDK config file exists at the path shown and is readable by the build user
  2. Check the path configured for the payment link SDK config in the build environment

When it happens

Trigger: Thrown at crates/payment_link/build.rs:29 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@705a321950 (2026-08-19). Data as JSON: /api/errors/5d2a7a31502d5e07. Report an issue: GitHub.