dagger/dagger · error

no scheme

Error message

no scheme

What it means

errNoMatch ('no import match') is the sentinel error returned by matchGoImport when none of the parsed go-import meta tags' prefixes is a whole-path-component prefix of the requested import path. In RepoRootForImportDynamic it is translated into 'parse %s: no go-import meta tags' rather than propagated as-is; in matchGoImport's second call site it surfaces as the bare sentinel.

Source

Thrown at engine/vcs/vcs.go:532

		// e.g. Bitbucket, GitLab
		Repo: strings.TrimSuffix(metaImport.RepoRoot, ".git"),
		Root: metaImport.Prefix,
	}
	if rr.VCS == nil {
		return nil, fmt.Errorf("%s: unknown vcs %q", urlStr, metaImport.VCS)
	}
	return rr, nil
}

// validateRepoRoot returns an error if repoRoot does not seem to be
// a valid URL with scheme.
func validateRepoRoot(repoRoot string) error {
	url, err := url.Parse(repoRoot)
	if err != nil {
		return err
	}
	if url.Scheme == "" {
		return errors.New("no scheme")
	}
	return nil
}

// metaImport represents the parsed <meta name="go-import"
// content="prefix vcs reporoot" /> tags from HTML files.
type metaImport struct {
	Prefix, VCS, RepoRoot string
}

// errNoMatch is returned from matchGoImport when there's no applicable match.
var errNoMatch = errors.New("no import match")

// pathPrefix reports whether sub is a prefix of s,
// only considering entire path components.
func pathPrefix(s, sub string) bool {
	// strings.HasPrefix is necessary but not sufficient.
	if !strings.HasPrefix(s, sub) {

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Check the import path against the Prefix values in the page's go-import tags and use the advertised prefix
  2. Update the meta tag to cover the full module path, e.g. content="uni.edu/bobby/proj vcs repo"
  3. Remember prefix matching is per path component: 'uni.edu/bob' does not match 'uni.edu/bobby/proj'
  4. If the error message is 'parse <url>: no go-import meta tags', it means errNoMatch occurred after tags were parsed — compare paths carefully

Example fix

<!-- before: prefix doesn't cover the import -->
<meta name="go-import" content="uni.edu/bob git https://github.com/bob/proj">
<!-- importing uni.edu/bobby/proj fails -->
<!-- after -->
<meta name="go-import" content="uni.edu/bobby/proj git https://github.com/bob/proj">
Defensive patterns

Strategy: try-catch

Validate before calling

func tagMatchesPath(tag, importPath string) bool {
    prefix := strings.Fields(tag)[0]
    rem := strings.TrimPrefix(importPath, prefix)
    return strings.HasPrefix(importPath, prefix) && (rem == "" || strings.HasPrefix(rem, "/"))
}

Try / catch

rr, err := RepoRootForImportDynamic(path, false)
if err != nil && strings.Contains(err.Error(), "no go-import meta tags") {
    return fmt.Errorf("no meta tag prefix covers %q; verify module name matches the tag prefix", path)
}

Prevention

When it happens

Trigger: Calling RepoRootForImportDynamic on an import path whose host page contains go-import meta tags but none whose Prefix matches the path at a path-component boundary, e.g. page advertises prefix 'uni.edu/bob' while importing 'uni.edu/bobby/proj'. Also returned directly from matchGoImport in tests.

Common situations: Typo in the import path (wrong module name); meta tag prefix doesn't cover the imported subpackage; trailing-segment mismatches after removing '..' components; importing a path the vanity host deliberately doesn't serve.

Related errors


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/adff4b0f43bf5ffc. Report an issue: GitHub.