microsoft/typescript-go · error

unable to open pipe: %w

Error message

unable to open pipe: %w

What it means

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

Source

Thrown at internal/fswatch/inotify_linux.go:139

func newInotifyBackend() *inotifyBackend {
	b := &inotifyBackend{
		pipeFDs:         [2]int{-1, -1},
		inotify:         -1,
		subscriptions:   map[int][]*inotifySubscription{},
		endedSignal:     make(chan struct{}),
		readBuf:         make([]byte, inotifyBufferSize),
		watchersTouched: make(map[*dirWatch]struct{}),
	}
	b.pipeWriteFD.Store(-1)
	b.watcherBase.init(b)
	return b
}

// start mirrors `inotifyBackend::start`.
func (b *inotifyBackend) start() error {
	// Create a pipe so we can wake the poll(2) loop on shutdown.
	if err := unix.Pipe2(b.pipeFDs[:], unix.O_CLOEXEC|unix.O_NONBLOCK); err != nil {
		return fmt.Errorf("unable to open pipe: %w", err)
	}
	b.pipeWriteFD.Store(int32(b.pipeFDs[1]))
	defer func() {
		b.closeFDs()
		close(b.endedSignal)
	}()
	fd, err := unix.InotifyInit1(unix.IN_NONBLOCK | unix.IN_CLOEXEC)
	if err != nil {
		return fmt.Errorf("unable to initialize inotify: %w", err)
	}
	b.inotify = fd

	pollfds := []unix.PollFd{
		{Fd: int32(b.pipeFDs[0]), Events: unix.POLLIN},
		{Fd: int32(b.inotify), Events: unix.POLLIN},
	}

	b.notifyStarted()

View on GitHub (pinned to 1bcfa18d79)

When it happens

Trigger: Thrown at internal/fswatch/inotify_linux.go:139 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/e84d5b30d8f97eec. Report an issue: GitHub.