{"record":{"id":"57cd737299e35afe","repo":"microsoft/typescript-go","slug":"unable-to-initialize-inotify-w","errorCode":null,"errorMessage":"unable to initialize inotify: %w","messagePattern":"unable to initialize inotify: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/fswatch/inotify_linux.go","lineNumber":148,"sourceCode":"\tb.pipeWriteFD.Store(-1)\n\tb.watcherBase.init(b)\n\treturn b\n}\n\n// start mirrors `inotifyBackend::start`.\nfunc (b *inotifyBackend) start() error {\n\t// Create a pipe so we can wake the poll(2) loop on shutdown.\n\tif err := unix.Pipe2(b.pipeFDs[:], unix.O_CLOEXEC|unix.O_NONBLOCK); err != nil {\n\t\treturn fmt.Errorf(\"unable to open pipe: %w\", err)\n\t}\n\tb.pipeWriteFD.Store(int32(b.pipeFDs[1]))\n\tdefer func() {\n\t\tb.closeFDs()\n\t\tclose(b.endedSignal)\n\t}()\n\tfd, err := unix.InotifyInit1(unix.IN_NONBLOCK | unix.IN_CLOEXEC)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to initialize inotify: %w\", err)\n\t}\n\tb.inotify = fd\n\n\tpollfds := []unix.PollFd{\n\t\t{Fd: int32(b.pipeFDs[0]), Events: unix.POLLIN},\n\t\t{Fd: int32(b.inotify), Events: unix.POLLIN},\n\t}\n\n\tb.notifyStarted()\n\n\tfor {\n\t\t_, err := unix.Poll(pollfds, 500)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, unix.EINTR) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unable to poll: %w\", err)\n\t\t}","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/fswatch/inotify_linux.go#L130-L166","documentation":"Error \"unable to initialize inotify: %w\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/fswatch/inotify_linux.go:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}