Hi everyone, I am having some troubles implementin...
# pact-js
f
Hi everyone, I am having some troubles implementing contract testing using docker on a mac. I am getting the following error running the consumer test:
Copy code
[02:37:53.258] ERROR (196): pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')
I am running inside a container with node 16. I can provide the full stack and more info. Thank you in advance
this is the command I am running
Copy code
"test:pact:consumer": "VERBOSE=true mocha test/contract/*.test.js --exit"
it breaks trying to create the MessageConsumerPact
Copy code
const messagePact = new MessageConsumerPact({
        consumer: 'patient.created-service-integrations',
        provider: 'patient.created-provider',
        // dir: path.resolve(process.cwd(), 'pacts'),
        pactfileWriteMode: 'update', // @todo
        logLevel: 'trace', // @todo
    })
j
It would appear that the Pact FFI (a rust binary library providing the core functions) is not found/available. It might be related to the way you installed Pact? Would you mind sharing? Can you see whether manually downloading the ffi helps? (You'll have to extract the library to somewhere that can be found, or update the
LD_LIBRARY_PATH
environment variable if using a non-standard location).
f
I have used
npm install @pact-foundation/pact
m
Sorry for the delay in responding Francisco, I’ve been on leave
I noticed your (two) bug reports, thanks. I’ll see if I can reproduce it
🙏 1
f
Thank you :) any additional info you need let me know
👍 1
y
what docker image and docker client ( docker desktop for mac or other ) is the mac intel or apple silicon based?
f
mac m1 Docker desktop 4.24.2 (124339) docker image node:16
m
I think I've gotten to the bottom of it, see issue
f
Problem gone using node 20, thank you for your help! But I am having another problem now, I'll write in a separated message
🚀 1
👍 1