microsoft/typescript-go · error

unable to watch pipe: %w

Error message

unable to watch pipe: %w

What it means

Error "unable to watch pipe: %w" thrown in microsoft/typescript-go.

Source

Thrown at internal/fswatch/kqueue.go:174

	b.kq = kq
	defer func() {
		b.closeSubscriptions()
		b.closeFDs()
		close(b.endedSignal)
	}()

	if err := unix.Pipe(b.pipeFDs[:]); err != nil {
		return fmt.Errorf("unable to open pipe: %w", err)
	}
	b.pipeWriteFD.Store(int32(b.pipeFDs[1]))

	// 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

View on GitHub (pinned to 1bcfa18d79)

When it happens

Trigger: Thrown at internal/fswatch/kqueue.go:174 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/09684afc5d3c88a1. Report an issue: GitHub.