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 <- nilView on GitHub (pinned to e2d772072e)
Solutions
- Filter the input list to extensions with registered parsers before mapping
- Handle Dockerfile-style detection for naming variants if intended
- Register/add a parser for the language if support is required
- 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
- Whitelist extensions before batch mapping
- Check for Dockerfile naming variants explicitly
- Register parsers for languages you need to map
- Log and skip rather than abort on unsupported types
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
- error validating original file syntax: %v
- error mapping file %s: %v
- failed to parse file: %v
- failed to parse the original content: %v
- failed to parse the proposed content: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/23b4c8261059e363.
Report an issue: GitHub.