microsoft/typescript-go · error

Error reading from inotify: %w

Error message

Error reading from inotify: %w

What it means

Error "Error reading from inotify: %w" thrown in microsoft/typescript-go.

Source

Thrown at internal/fswatch/inotify_linux.go:267

		return 0, err
	}
	sub := &inotifySubscription{path: path, watchPath: watchPath, dirWatch: w, wd: wd}
	b.subscriptions[wd] = append(b.subscriptions[wd], sub)
	return wd, nil
}

// handleEvents mirrors `inotifyBackend::handleEvents`.
func (b *inotifyBackend) handleEvents() error {
	buf := b.readBuf
	watchersTouched := b.watchersTouched

	for {
		n, err := unix.Read(b.inotify, buf)
		if err != nil {
			if errors.Is(err, unix.EAGAIN) || errors.Is(err, unix.EWOULDBLOCK) {
				break
			}
			return fmt.Errorf("Error reading from inotify: %w", err)
		}
		if n == 0 {
			break
		}
		// Walk the buffer.
		for offset := 0; offset < n; {
			ev := (*unix.InotifyEvent)(unsafe.Pointer(&buf[offset]))
			recordSize := unix.SizeofInotifyEvent + int(ev.Len)
			var name string
			if ev.Len > 0 {
				// Name is NUL-terminated; trim trailing zeros.
				nameBytes := buf[offset+unix.SizeofInotifyEvent : offset+recordSize]
				for i, c := range nameBytes {
					if c == 0 {
						nameBytes = nameBytes[:i]
						break
					}
				}

View on GitHub (pinned to 1bcfa18d79)

When it happens

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