jdx/mise · error

must set a non-empty `url`

Error message

must set a non-empty `url`

What it means

The `url` value is trimmed of surrounding whitespace and must not be empty. An empty (or whitespace-only) url would produce a broken `git clone`/`git fetch` invocation, so from_toml rejects it explicitly. This is distinct from the url-missing case: the key exists but holds no value.

Solutions

  1. Set the url to the actual git remote, e.g. `url = "https://github.com/jdx/dotfiles.git"`
  2. If the value comes from a template/variable, ensure it resolves non-empty at render time
  3. Delete the entry until a valid url is known

Example fix

// before
"~/src/dotfiles" = { url = "" }
// after
"~/src/dotfiles" = { url = "https://github.com/jdx/dotfiles.git" }
Defensive patterns

Strategy: validation

Validate before calling

function validateUrl(entry) {
  const url = (entry.url ?? '').trim();
  if (url.length === 0) throw new Error('url must be a non-empty git remote');
}

Prevention

When it happens

Trigger: Writing `url = ""` or `url = " "` in a `[bootstrap.repos]` entry.

Common situations: Templated or env-interpolated config where the url variable expanded to empty; clearing a url by hand without removing the entry; a TOML placeholder left unfilled.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/618d00c3c4321f1f. Report an issue: GitHub.

Appendix: source

Thrown at src/system/repos.rs:127

                    "relative repo path `{path_raw}` must name a directory inside the project root"
                );
            }
            // Join only the Normal segments so `./foobar` resolves to
            // `<root>/foobar` rather than `<root>/./foobar` — a `.` component
            // survives `Path::join` and leaks into every displayed path.
            let mut resolved = root.to_path_buf();
            for component in path.components() {
                if let Component::Normal(segment) = component {
                    resolved.push(segment);
                }
            }
            resolved
        };
        let Some(url) = config.url.map(|s| s.trim().to_string()) else {
            bail!("must set `url`");
        };
        if url.is_empty() {
            bail!("must set a non-empty `url`");
        }
        if url.starts_with('-') {
            bail!("`url` must not start with `-`");
        }
        let git_ref = config.git_ref.map(|s| s.trim().to_string());
        let git_ref = match git_ref {
            Some(git_ref) if git_ref.is_empty() => bail!("`ref` must not be empty"),
            Some(git_ref) if git_ref.starts_with('-') => bail!("`ref` must not start with `-`"),
            other => other,
        };
        Ok(Self {
            path_raw,
            path,
            url,
            git_ref,
        })
    }
}

View on GitHub (pinned to 533346cc37)