{"record":{"id":"dc1c86ade178d221","repo":"microsoft/typescript-go","slug":"kevent-error-w","errorCode":null,"errorMessage":"kevent error: %w","messagePattern":"kevent error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/fswatch/kqueue.go","lineNumber":186,"sourceCode":"\t// WatchDirectory kqueue to the read side of the pipe so we can break the\n\t// loop on shutdown. SetKevent handles the per-arch Ident type\n\t// (uint64 on 64-bit, uint32 on 386/arm).\n\tvar pipeEv unix.Kevent_t\n\tunix.SetKevent(&pipeEv, b.pipeFDs[0], unix.EVFILT_READ, unix.EV_ADD|unix.EV_CLEAR)\n\tif _, err := unix.Kevent(kq, []unix.Kevent_t{pipeEv}, nil, nil); err != nil {\n\t\treturn fmt.Errorf(\"unable to watch pipe: %w\", err)\n\t}\n\n\tb.notifyStarted()\n\n\tevents := make([]unix.Kevent_t, 128)\n\tfor {\n\t\tn, err := unix.Kevent(kq, nil, events, nil)\n\t\tif err != nil {\n\t\t\tif err == unix.EINTR {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"kevent error: %w\", err)\n\t\t}\n\n\t\twatchersTouched := b.watchersTouched\n\t\tstop := false\n\t\tfor i := range n {\n\t\t\tfflags := events[i].Fflags\n\t\t\tflags := events[i].Flags\n\t\t\tfd := int(events[i].Ident)\n\t\t\tif fd == b.pipeFDs[0] {\n\t\t\t\tstop = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// EV_ERROR indicates kevent couldn't apply a changelist\n\t\t\t// entry or that the kernel rejected the registration.\n\t\t\t// Data carries the errno. Skip dispatching as a normal\n\t\t\t// event since fflags are not meaningful in this case.\n\t\t\tif flags&unix.EV_ERROR != 0 {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/fswatch/kqueue.go#L168-L204","documentation":"Error \"kevent error: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/fswatch/kqueue.go:186 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"}