jdx/mise · error

packslip plugin version must not be empty

Error message

packslip plugin version must not be empty

What it means

After parsing a packslip source's project part, PackslipSource::parse (src/plugins/packslip.rs:37) validates the version request after the `#` separator. If the user wrote `packslip:github.com/org/repo#` with nothing following, the request is an empty string and mise rejects it — an empty version request is never valid (use the repo alone for `latest`).

Solutions

  1. Remove the trailing `#` entirely — `packslip:github.com/org/repo` defaults to `latest`.
  2. Or supply a concrete version after the `#`, e.g. `packslip:github.com/org/repo#1.2.3`.
  3. Validate your mise.toml with `mise ls` or `mise doctor` after edits to catch malformed tool specs early.
  4. If a variable builds the spec, guard against empty version interpolation before formatting the source string.

Example fix

// before
[tools]
mytool = "packslip:github.com/acme/mytool#"
// after
[tools]
mytool = "packslip:github.com/acme/mytool"
Defensive patterns

Strategy: validation

Validate before calling

fn has_nonempty_request(src: &str) -> bool {
  src.strip_prefix("packslip:")
    .map_or(false, |rest| {
      rest.split_once('#').map_or(true, |(_, req)| !req.is_empty())
    })
}

Try / catch

match parse_source(spec) {
  Err(e) if e.to_string().contains("must not be empty") => {
    eprintln!("drop the trailing '#' or provide a version after it");
  }
  other => other?,
}

Prevention

When it happens

Trigger: Specifying a packslip source with a trailing `#` and no version, e.g. `mise use packslip:github.com/org/repo#` in mise.toml or on the CLI. Empty string after split_once('#') triggers the ensure!.

Common situations: Autocomplete/template residue leaving a dangling `#`; a hand-edited mise.toml where the version was deleted but the separator kept; copy-paste truncation cutting off the version string.

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/c96349a6eeb739e6. Report an issue: GitHub.

Appendix: source

Thrown at src/plugins/packslip.rs:37

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct Source {
    project: String,
    request: String,
}

impl Source {
    pub(crate) fn parse(value: &str) -> Result<Option<Self>> {
        let Some(value) = value.strip_prefix("packslip:") else {
            return Ok(None);
        };
        let (project, request) = value.split_once('#').unwrap_or((value, "latest"));
        let project = project_name(project)?;
        ensure!(
            project.starts_with("github.com/") && packslip::model::repository(&project).is_some(),
            "packslip plugin sources currently require a GitHub repository"
        );
        ensure!(
            !request.is_empty(),
            "packslip plugin version must not be empty"
        );
        Ok(Some(Self {
            project,
            request: request.to_owned(),
        }))
    }

    pub(crate) fn url(&self) -> String {
        format!("packslip:{}#{}", self.project, self.request)
    }

    pub(crate) fn with_version(mut self, version: Option<String>) -> Self {
        if let Some(version) = version {
            self.request = version;
        }
        self

View on GitHub (pinned to 533346cc37)