Hi, does anyone know why one of my colleagues is g...
# pact-js
m
Hi, does anyone know why one of my colleagues is getting the following error? this is a sample repo but he’s getting that error, he tried another repo, and the same thing. Same code is working fine on my local. Cannot find addinteraction
m
Does the log file show anything?
t
This is an old version of pact - if you can upgrade it might be fixed (and it definitely will have a better error message)
usually this happens if setup hasn’t been called first
m
the weird thing is that the same code is working on my local, but the other guy just download the code, ran the npm install and he is getting that error 🤔
m
the two things that come to mind 1. Are you running windows or Mac? 2. Possibly, they are running into the windows long path issue (google it + Pact to see relevant issues). Move the project closer to
c:\
and it might fix it 3. There is some error that’s not surfacing (e.g. the port is taken). You can check that by running
lsof -i:<port>
(replace the
<port>
with the relevant port the test is using). Similarly, a Ruby process could be hanging around (
ps -ef | grep ruby
should show that). I realise these are linux commands…so, probably need to check As Tim said, newer versions of Pact JS won’t have this problem, so really you should update
I’ll reach out to Rafaela to see if she is willing to update to the latest
m
I’m running mac, he’s running windows… we tried the short path and it didn’t work… I’ll tell him to try the newer version,
and thanks again for the answers, really appreciate it
👍 1
t
You're using pact-js 9.x, which requires the
setup
method to complete before running tests. My guess is that you're not waiting for the promise to complete.
If you can share your test file, we can take a look and probably point out the error
☝️ 1
m
thanks Tim, he upgrade to the latest pact and now he’s getting this error (Windows machine)
that could be a port thing, right?
t
Follow the instructions in that error message
m
yeah, he’s doing that… I just wondering why the same code is working on my side but it’s failing on windows
t
There should be answers in the logs, and if there isn’t, it might be in how it is being used. If you can share your test file we can help more
☝️ 1
m
we need logs and/or a reproducible example
Screenshots are usually not very helpful - text logs are