:wave: Hey folks. Had a quick question and I'm no...
# pact-js
l
👋 Hey folks. Had a quick question and I'm not sure if there's a know GH issue around it or this has been asked previously in slack. We've been running into an issue with spinning up the mock provider at runtime when using node 18:
Copy code
connect ECONNREFUSED ::1:8080
Making a switch back to 16 works. Curious if there's been a solution to this or path forward? We're looking to start running things in CI and wondering if we'd have to pull down a specific node docker container when running pact tests.
m
It’s to do with networking changes in Node 18+
👍 1
If you manually set the host to
127.0.0.1
that will probably address it (i.e. an ipv4 address)
I can’t remember the specifics, but it’s something like by default
localhost
maps to
::1
on on ipv6 networks
this up arrow 1
l
Ah copy that. Thanks Matt. Let me try manually setting the host.
t
There's also a change to the way that connection pooling works. The details are in the node release notes, and also on an issue in github I think
👍 2
m
Thanks, I meant to send that link but clearly I got side tracked
l
FWIW - I did come across the relevant Pact GH issues: • https://github.com/pact-foundation/pact-js/discussions/1083https://github.com/pact-foundation/pact-js/issues/1066 I changed refs to
localhost
to
127.0.0.1
but to no avail:
Copy code
const provider = new Pact({
    consumer: consumerName,
    provider: providerName,
    host: '127.0.0.1',
    port: 8080,
    log: path.resolve(process.cwd(), 'logs', 'pact.log'),
    dir: pactDir,
});
I'm also on
arm64
if that helps
Ah. Nevermind. I forgot to change
localhost
at the actual callsite when making a call with axios.
🙌 1
working now -- apologize for the additional noise!
❤️ 1