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

TypeError: createColors is not a function (pino-pretty dependency) #1115

Closed
5 tasks done
brucem1976 opened this issue Sep 7, 2023 · 4 comments
Closed
5 tasks done
Labels
bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer

Comments

@brucem1976
Copy link

brucem1976 commented Sep 7, 2023

Software versions

  • OS: Mac OSX 13.5.1
  • Consumer Pact library: Pact JS v12.1.0
  • Node Version: 18.16.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

react-scripts test --testTimeout 30000 pact.spec.js runs the consumer test adapted from the Getting Started tutorial

Actual behaviour

  FAIL  src/builder/pact/api.pact.spec.js
  ● Test suite failed to run

    TypeError: createColors is not a function

    > 1 | import { PactV3 } from '@pact-foundation/pact';
        | ^
      2 |
      3 | const mockProvider = new PactV3({
      4 |     logLevel: 'debug',

      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)

Steps to reproduce

import { PactV3 } from '@pact-foundation/pact';

const mockProvider = new PactV3({
    logLevel: 'debug',
    consumer: 'pactflow-platform-ui',
    // provider:  'pactflow-graphql'
});

describe('GQL Pact tests', () => {
 });

Relevant log files

As above - log level set to debug on the configuration of PactV3

@brucem1976 brucem1976 added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Sep 7, 2023
@mefellows
Copy link
Member

Are you able to please share a repro? It's possible it's a configuration of the build causing this issue, otherwise I'd expect to see it in the CI builds for this repo.

@brucem1976
Copy link
Author

@mefellows thanks so much for taking a look - https://github.com/brucem1976/pact-test with yarn install and npm run test:pact reproduces it - seems to be something related to the specific package.json contents

@brucem1976 brucem1976 changed the title TypeError: cresteColors is not a function (pino-pretty dependency) TypeError: createColors is not a function (pino-pretty dependency) Sep 8, 2023
@brucem1976
Copy link
Author

@mefellows I think I tracked down the issue - [email protected] far too old, seems to work fine with [email protected]

@mefellows
Copy link
Member

Thanks for this! That makes some sense, it looks like we'll need to upgrade the examples.

I'll close this for now, as it looks like a compatibility issue with react scripts. If there is something we could be doing, we can re-open and address.

@github-project-automation github-project-automation bot moved this from New Issue to Closed in Pact Triage (not yet in use) Sep 11, 2023
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 triage This issue is yet to be triaged by a maintainer
Projects
Status: Closed
Development

No branches or pull requests

2 participants