unjs/consola

Updating Consola from v2 to v3 resulting into a syntax error

YuryShkoda opened this issue · 2 comments

Environment

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

Reproduction

  1. sasjs/utils#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 sasjs/cli#1367.

Thank you very much for your help in advance!

Logs

No response

pi0 commented

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.

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.