Closed larixer closed 4 years ago
The possible workaround is to initalize dnsCache
like this:
const dnsCache = new Map([[
'cached-lookup:localhost:4', JSON.stringify({
value: [{
address: '127.0.0.1',
ttl: 268,
family: 4,
expires: Date.now() + 24 * 3600 * 1000,
}],
expires: Date.now() + 24 * 3600 * 1000,
}),
]]);
@szmarczak Any thoughts about this issue, we are seeing this problem when running Yarn 2 integration tests on GitHub Actions Mac OS X matrix target.
Sorry for replying this late, somehow I didn't get a notification for the two previous comments :thinking:
Please make sure you're running cacheable-lookup@4.1.2
. It reads the hosts
file.
hosts
file? Is it /etc/hosts
?localhost
or not.@szmarczak Thanks! Indeed it works with 4.1.2
. But the latest
tag on npm is assigned to cacheable-lookup@2.0.1
, is this intended?
$ yarn info cacheable-lookup
yarn info v1.22.4
{
name: 'cacheable-lookup',
'dist-tags': {
latest: '2.0.1'
},
But the latest tag on npm is assigned to cacheable-lookup@2.0.1, is this intended?
No. Doesn't npm
update the latest
tag automatically? I haven't altered with it in any way. Looking at this now.
@larixer Fixed. The latest points now to 4.1.2
.
@szmarczak Cool, thank you very much!
Steps for reproduction:
package.json
:index.js
:The output under OS X Mojave:
This problem in consequence makes
got
to fail withdnsCache
enabled on OS X when requests tohttp://localhost
are issued.P.S. Please note that issue reproduces only on OS X, it does not reproduce neither on Windows nor on Linux