Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected]: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel') #1147

Closed
4 of 5 tasks
fbarril opened this issue Jan 7, 2024 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues, pull requests, or discussions triage This issue is yet to be triaged by a maintainer

Comments

@fbarril
Copy link

fbarril commented Jan 7, 2024

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

[03:01:45.022] ERROR (361): [email protected]: 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

  • OS: _e.g. Mac OS sonoma 14.2.1
  • Pact Node version: _e.g. Pact Node v12.1.1
  • Node Version: v16.20.2

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

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): [email protected]: 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)
@fbarril fbarril added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Jan 7, 2024
@mefellows
Copy link
Member

Closing as duplicate of pact-foundation/pact-js-core#472.

@mefellows mefellows added the duplicate Indicates similar issues, pull requests, or discussions label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues, pull requests, or discussions triage This issue is yet to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants