<#1130 TypeError: createColors is not a function (...
# pact-js-development
g
#1130 TypeError: createColors is not a function (Umi3) Issue created by Canoe-Silhouette TypeError: createColors is not a function (Umi3) Software versions Please provide at least OS and version of pact-js • OS: Windows 10 • Consumer Pact library: Pact JS v12.1.0 • Node Version: 16.19.1 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 Run PactV3 tests in Umi(v3.5). Actual behaviour Our team use Umi(v3.5) as the front-end framework, but we can't run the pact tests.
Copy code
PS D:\workspace\umi3> yarn test
yarn run v1.22.11
$ umi-test
 FAIL  tests/pact.test.js
  ● Test suite failed to run

    TypeError: createColors is not a function

      1 | import { string} from "@pact-foundation/pact/src/dsl/matchers";
    > 2 | const { MatchersV3} = require('@pact-foundation/pact');
        |                       ^
      3 | const { atLeastOneLike} = MatchersV3;
      4 | export const data = {
      5 |     code:0,

      at Object.<anonymous> (node_modules/pino-pretty/lib/colors.js:19:25)
      at Object.<anonymous> (node_modules/pino-pretty/index.js:8:16)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/logger/pino.ts:2:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/logger/index.ts:2:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/spawn/spawn.ts:5:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/spawn/index.ts:1:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/service.ts:11:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/server.ts:6:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/pact.ts:5:1)
      at Object.<anonymous> (node_modules/@pact-foundation/pact-core/src/index.ts:1:1)
      at Object.<anonymous> (node_modules/@pact-foundation/src/httpPact/index.ts:1:1)
      at Object.<anonymous> (node_modules/@pact-foundation/src/index.ts:25:1)
      at Object.<anonymous> (tests/overview.js:2:23)
      at Object.<anonymous> (tests/pact.test.js:3:1)
We've tried to use Pact JS v9.11.1, this version can run properly in Umi(v3.5), but the matching rules in PactV2 can't meet our needs. So we want to use PactV3 in our project. In addition, Pact JS v12.1.0 can run in Umi4, but it's difficult for us to upgrade the old project. Steps to reproduce https://github.com/Canoe-Silhouette/pact-umi pact-foundation/pact-js