Skip to content

Windows 11: Exception during run: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel') #608

@vlevkoniuk

Description

@vlevkoniuk

Software versions

Please provide at least OS and version of pact-js

  • OS: Windows 11 Pro (latest)
  • Pact Node version: "@pact-foundation/pact": "^14.0.0",
  • Node Version: 22

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

Windows 11 should support pact tests like the Windows 10 does

Actual behaviour

Exception during run: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')

Steps to reproduce

On a Windows 11 machine install @pact-foundation/pact": "^14.0.0", and write some test that has

const provider = new PactV3({
        consumer: 'consumer-v3',
        provider: 'provider-v3'
    });

The execution will fail before mocha (test framework begin to lunch test)

> cross-env LOG_LEVEL=trace CI=true mocha

Debugger attached.
Debugger attached.
[21:34:49.288] DEBUG (5052): pact-core@16.0.0: We detected your platform as: 

 - win32-x64

 Exception during run: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')
    at getFfiLib (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\@pact-foundation\pact-core\src\ffi\index.ts:188:14)
    at makeConsumerPact (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\@pact-foundation\pact-core\src\consumer\index.ts:71:24)
    at PactV3.PactV3.setup (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\@pact-foundation\src\v3\pact.ts:250:33)
    at new PactV3 (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\@pact-foundation\src\v3\pact.ts:49:10)
    at Suite.<anonymous> (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\tests\image-service-pact-v3.spec.ts:9:22)
    at Object.create (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\interfaces\common.js:148:19)
    at context.describe.context.context (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\interfaces\bdd.js:42:27)
    at <anonymous> (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\tests\image-service-pact-v3.spec.ts:6:1)
    at Object.<anonymous> (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\tests\image-service-pact-v3.spec.ts:87:2)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object.transformer (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\tsx\dist\register-DCnOAxY2.cjs:2:1186)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at cjsLoader (node:internal/modules/esm/translators:262:5)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:196:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:578:26)
    at async formattedImport (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\nodejs\esm-utils.js:9:14)
    at async exports.requireOrImport (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\nodejs\esm-utils.js:42:28)
    at async exports.loadFilesAsync (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\nodejs\esm-utils.js:100:20)
    at async singleRun (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\cli\run-helpers.js:162:3)
    at async exports.handler (C:\Users\vlevkoniuk\sources\QA-AUTOMATION-TYPESCRIPT-1\lesson13-contract-testing\node_modules\mocha\lib\cli\run.js:375:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting feedbackAwaiting Feedback from OPbugIndicates an unexpected problem or unintended behaviortriageThis issue is yet to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions