microsoft/typescript-go · error

unable to initialize inotify: %w

Error message

unable to initialize inotify: %w

What it means

Error "unable to initialize inotify: %w" thrown in microsoft/typescript-go.

Source

Thrown at internal/fswatch/inotify_linux.go:148

	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()

	for {
		_, err := unix.Poll(pollfds, 500)
		if err != nil {
			if errors.Is(err, unix.EINTR) {
				continue
			}
			return fmt.Errorf("unable to poll: %w", err)
		}

View on GitHub (pinned to 1bcfa18d79)

When it happens

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