consola icon indicating copy to clipboard operation
consola copied to clipboard

Updating Consola from v2 to v3 resulting into a syntax error

Open YuryShkoda opened this issue 1 year ago • 2 comments

Environment

Node.js: v18.14.2 npm: v9.5.0 typescript: v5.1.6

Reproduction

  1. https://github.com/sasjs/utils/pull/241
  2. package @sasjs/utils using npm run package:lib script
  3. clone @sasjs/cli
  4. install packaged @sasjs/utils to @sasjs/cli by running npm i ../utils/build/sasjs-utils-5.0.0.tgz && npm start
  5. run any sasjs comand (eg sasjs help)

Describe the bug

Bumping consola from v2(we were using 2.15.0) to v3(eg 3.2.3 or any 3.*) resulting into a syntax error. image

Additional context

The main goal of bumping the version of consola, which was working great so far, is to be able to disable colors in logged messages. Related issue https://github.com/sasjs/cli/issues/1367.

Thank you very much for your help in advance!

Logs

No response

YuryShkoda avatar Aug 10 '23 09:08 YuryShkoda

Hi. Thanks for raising the issue. The syntax error you are getting with ?? is Nullish coalescing operator. It is supported in Node.js 18 but there is possibility that you are using an older Webpack, jest runner or babel version that is not supporting this syntax.

pi0 avatar Aug 10 '23 13:08 pi0

Hi @pi0, Thanks for getting back to me. The project doesn't use webpack, it is packed using tsc(v5.1.6) command. Jest version is almost the latest: jest v29.4.3 and babel-jest v29.4.3. Project configuration can be found here.

YuryShkoda avatar Aug 10 '23 15:08 YuryShkoda