unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6.12k stars 175 forks source link

Updating Consola from v2 to v3 resulting into a syntax error #222

Open YuryShkoda opened 1 year ago

YuryShkoda commented 1 year ago

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

pi0 commented 1 year ago

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.

YuryShkoda commented 1 year ago

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.