plandex-ai/plandex · error

unsupported file type: %s

Error message

unsupported file type: %s

What it means

When building file maps for plain (non-Dockerfile) files, multi.go resolves a parser via syntax.GetParserForPath(path). If no parser is registered for the file's extension/language, the goroutine emits 'unsupported file type: %s'. The library cannot structurally map file types it has no grammar for.

Source

Thrown at app/server/syntax/file_map/multi.go:95

type MapTrees map[string]string

func ProcessMapTrees(ctx context.Context, inputs map[string]string) (MapTrees, error) {
	trees := make(MapTrees, len(inputs))
	var mu sync.Mutex
	errCh := make(chan error, len(inputs))

	for path, content := range inputs {
		go func(path, content string) {
			// Get appropriate parser
			var parser *tree_sitter.Parser
			file := filepath.Base(path)
			if strings.Contains(strings.ToLower(file), "dockerfile") {
				parser = syntax.GetParserForLanguage(shared.LanguageDockerfile)
			} else {
				parser, _, _, _ = syntax.GetParserForPath(path)

				if parser == nil {
					errCh <- fmt.Errorf("unsupported file type: %s", path)
					return
				}
			}

			contentBytes := []byte(content)

			// Parse file
			tree, err := parser.ParseCtx(ctx, nil, contentBytes)
			if err != nil {
				errCh <- fmt.Errorf("failed to parse file: %v", err)
				return
			}
			defer tree.Close()

			mu.Lock()
			defer mu.Unlock()
			trees[path] = string(tree.RootNode().String())
			errCh <- nil

View on GitHub (pinned to e2d772072e)

Solutions

  1. Filter the input list to extensions with registered parsers before mapping
  2. Handle Dockerfile-style detection for naming variants if intended
  3. Register/add a parser for the language if support is required
  4. Skip and log unsupported files instead of failing the whole batch

Example fix

// before
paths, _ := allFilesUnder(root)
MultiMapFile(ctx, paths)
// after
var supported []string
for _, p := range paths {
    if parser, _, _, _ := syntax.GetParserForPath(p); parser != nil {
        supported = append(supported, p)
    }
}
MultiMapFile(ctx, supported)
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(strings.ToLower(path), "dockerfile") {
    if parser, _, _, _ := syntax.GetParserForPath(path); parser == nil {
        return fmt.Errorf("skip unsupported: %s", path)
    }
}

Type guard

func supportedForMapping(path string) bool {
    if strings.Contains(strings.ToLower(path), "dockerfile") { return true }
    p, _, _, _ := syntax.GetParserForPath(path)
    return p != nil
}

Try / catch

err := <-errCh
if err != nil && strings.HasPrefix(err.Error(), "unsupported file type:") {
    log.Printf("ignoring unsupported file: %v", err)
}

Prevention

When it happens

Trigger: Including a file whose extension has no registered tree-sitter parser (and whose name doesn't contain 'dockerfile') in the multi-file mapping input.

Common situations: Mapping directories containing binaries, lock files, config formats (e.g. .yaml, .json, .toml depending on registered grammars), vendored assets, or files with unusual/no extensions.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/23b4c8261059e363. Report an issue: GitHub.