{"record":{"id":"ae1c352e50a558b4","repo":"microsoft/typescript-go","slug":"unable-to-remove-dirwatch-w","errorCode":null,"errorMessage":"unable to remove dirWatch: %w","messagePattern":"unable to remove dirWatch: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/fswatch/inotify_linux.go","lineNumber":417,"sourceCode":"func (b *inotifyBackend) closeWatch(w *dirWatch) error {\n\tvar firstErr error\n\tfor wd, list := range b.subscriptions {\n\t\tkept := list[:0]\n\t\tremovedAny := false\n\t\tfor _, s := range list {\n\t\t\tif s.dirWatch == w {\n\t\t\t\tremovedAny = true\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkept = append(kept, s)\n\t\t}\n\t\tif !removedAny {\n\t\t\tcontinue\n\t\t}\n\t\tif len(kept) == 0 {\n\t\t\tif _, err := unix.InotifyRmWatch(b.inotify, uint32(wd)); err != nil && firstErr == nil {\n\t\t\t\tfirstErr = &dirWatchError{\n\t\t\t\t\terr:      fmt.Errorf(\"unable to remove dirWatch: %w\", err),\n\t\t\t\t\tdirWatch: w,\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete(b.subscriptions, wd)\n\t\t} else {\n\t\t\tb.subscriptions[wd] = kept\n\t\t}\n\t}\n\treturn firstErr\n}\n","sourceCodeStart":399,"sourceCodeEnd":428,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/fswatch/inotify_linux.go#L399-L428","documentation":"Error \"unable to remove dirWatch: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/fswatch/inotify_linux.go:417 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}