<#1044 Issue getting @pact-foundation/pact module ...
# pact-js-development
g
#1044 Issue getting @pact-foundation/pact module to even load Issue created by alilland Fresh install of
@pact-foundation/pact
results in pact not running
Copy code
$ jest tests/pact/ --runInBand
 FAIL  tests/pact/consumers/test.spec.js
  ● Test suite failed to run

    dlopen(/Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/pact.node, 0x0001): Library not loaded: @rpath/libpact_ffi.dylib
      Referenced from: <F1F75702-EE69-3F3A-A4D9-D477A43B6585> /Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/pact.node
      Reason: tried: '/Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.dylib' (no such file), '/Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libpact_ffi.dylib' (no such file), '/Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.dylib' (no such file), '/Users/aronlilland/Documents/dev/controlair/backbone-ui/applications/backbone/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.dylib' (no such file), '/usr/local/lib/libpact_ffi.dylib' (no such file), '/usr/lib/libpact_ffi.dylib' (no such file, not in dyld cache)

      at Runtime._loadModule (node_modules/jest-runtime/build/index.js:1180:29)
      at bindings (node_modules/bindings/bindings.js:112:48)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/ffi/index.ts:6:21)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.773 s
Ran all test suites matching /tests\/pact\//i.
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
Software versionsOS:
Ventura 13.0
Consumer Pact library:
@pact-foundation/pact ^10.4.0
Provider Pact library: haven't made it that far yet • Node Version:
v16.15.0
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 and have read the section on intermittent test failures ☑︎ 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 the library wont load, this is the entire test file from referenced above, i gutted it just to see if the module will load and it wont, tried es5 and es6
Copy code
import pact from '@pact-foundation/pact'

describe('The Dog API', () => {
  describe('get /dogs using builder pattern', () => {
    it('succeeds', () => {
      // Add expected interactions
    })
  })
})
Actual behaviour the library wont load pact-foundation/pact-js