microsoft/typescript-go · error

kevent error: %w

Error message

kevent error: %w

What it means

Error "kevent error: %w" thrown in microsoft/typescript-go.

Source

Thrown at internal/fswatch/kqueue.go:186

	// WatchDirectory kqueue to the read side of the pipe so we can break the
	// loop on shutdown. SetKevent handles the per-arch Ident type
	// (uint64 on 64-bit, uint32 on 386/arm).
	var pipeEv unix.Kevent_t
	unix.SetKevent(&pipeEv, b.pipeFDs[0], unix.EVFILT_READ, unix.EV_ADD|unix.EV_CLEAR)
	if _, err := unix.Kevent(kq, []unix.Kevent_t{pipeEv}, nil, nil); err != nil {
		return fmt.Errorf("unable to watch pipe: %w", err)
	}

	b.notifyStarted()

	events := make([]unix.Kevent_t, 128)
	for {
		n, err := unix.Kevent(kq, nil, events, nil)
		if err != nil {
			if err == unix.EINTR {
				continue
			}
			return fmt.Errorf("kevent error: %w", err)
		}

		watchersTouched := b.watchersTouched
		stop := false
		for i := range n {
			fflags := events[i].Fflags
			flags := events[i].Flags
			fd := int(events[i].Ident)
			if fd == b.pipeFDs[0] {
				stop = true
				break
			}

			// EV_ERROR indicates kevent couldn't apply a changelist
			// entry or that the kernel rejected the registration.
			// Data carries the errno. Skip dispatching as a normal
			// event since fflags are not meaningful in this case.
			if flags&unix.EV_ERROR != 0 {

View on GitHub (pinned to 1bcfa18d79)

When it happens

Trigger: Thrown at internal/fswatch/kqueue.go:186 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/typescript-go@1bcfa18d79 (2026-08-16). Data as JSON: /api/errors/dc1c86ade178d221. Report an issue: GitHub.