sindresorhus/alfred-npms

RequestError: read ECONNRESET

Open

#31 opened on Feb 1, 2022

View on GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (367 stars) (24 forks)user submission
enhancementhelp wanted

Description

Environment

  • MacOS Monterey 12.1
  • Node v16.13.2
  • Alfred 4.6.2

When I type anything, an error occurs.

"items": [
	{
		"title": "RequestError: read ECONNRESET",
		"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
		"valid": false,
		"text": {
			"copy": "```\nRequestError: read ECONNRESET\n    at ClientRequest.<anonymous> (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/got/dist/source/core/index.js:962:111)\n    at ClientRequest.origin.emit (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)\n```\n\n-\nnpms 3.0.0\nAlfred 4.6.2\ndarwin 21.2.0",
			"largetype": "RequestError: read ECONNRESET\n    at ClientRequest.<anonymous> (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/got/dist/source/core/index.js:962:111)\n    at ClientRequest.origin.emit (/Users/younho9/.nvm/versions/node/v16.13.2/lib/node_modules/alfred-npms/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)"
		},
		"icon": {
			"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
		}
	}
]

I found this issue comment, https://github.com/request/request-promise/issues/147#issuecomment-349148433, and I added Connection: 'keep-alive' header to alfred-npms/node_modules/alfy/index.js:137 then the error has been resolved.

response = await got(url, {headers: {Connection: 'keep-alive'}, searchParams: options.query}).json();

Is there anyone else who experiences this error? I wonder if should add a Connection: 'keep-alive' header to the alfy.fetch.

Contributor guide