pact-foundation / pact-js

JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
https://pact.io
Other
1.63k stars 348 forks source link

pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel') #1147

Closed fbarril closed 10 months ago

fbarril commented 10 months ago

I am getting the following error running inside a docker container on a mac m1.

[03:01:45.022] ERROR (361): pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')

    const messagePact = new MessageConsumerPact({
        consumer: 'a.b-service-i',
        provider: 'a.b-provider',
        pactfileWriteMode: 'update', 
        logLevel: 'trace', 
    })

I can provide more info if necessary.

Software versions

Issue Checklist

Please confirm the following:

Expected behaviour

Tests running

Actual behaviour

Test breaking trying to create MessageConsumerPact

Steps to reproduce

Follow the pact-js-workshop tutorial on a mac m1.

Relevant log files

[03:01:23.659] ERROR (337): pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')

Error: Failed to load native module, try setting LOG_LEVEL=debug for more info
    at initialiseFfi (/home/node/app/node_modules/@pact-foundation/pact-core/src/ffi/index.js:99:15)
    at getFfiLib (/home/node/app/node_modules/@pact-foundation/pact-core/src/ffi/index.js:106:15)
    at makeConsumerMessagePact (/home/node/app/node_modules/@pact-foundation/pact-core/src/consumer/index.js:127:37)
    at new MessageConsumerPact (/home/node/app/node_modules/@pact-foundation/pact/src/messageConsumerPact.js:57:66)
    at Suite.<anonymous> (/home/node/app/test/contract/patientCreated.test.js:10:25)
    at Object.create (/home/node/app/node_modules/mocha/lib/interfaces/common.js:148:19)
    at Object.only (/home/node/app/node_modules/mocha/lib/interfaces/common.js:106:21)
    at Function.context.describe.only (/home/node/app/node_modules/mocha/lib/interfaces/bdd.js:69:27)
    at Object.<anonymous> (/home/node/app/test/contract/patientCreated.test.js:9:10)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async formattedImport (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:7:14)
    at async Object.exports.requireOrImport (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:38:28)
    at async Object.exports.loadFilesAsync (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:91:20)
    at async singleRun (/home/node/app/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/home/node/app/node_modules/mocha/lib/cli/run.js:370:5)
mefellows commented 10 months ago

Closing as duplicate of https://github.com/pact-foundation/pact-js-core/issues/472.