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

Unexpected token '??=' with Node 14 #95

Closed
Endikaorve opened this issue Aug 13, 2024 · 4 comments
Closed

Unexpected token '??=' with Node 14 #95

Endikaorve opened this issue Aug 13, 2024 · 4 comments

Comments

@Endikaorve
Copy link

Endikaorve commented Aug 13, 2024

💥 Regression Report

Since yesterday, running the following command:
npx locize-cli download --format json --path <PATH> --api-key <API_KEY> --project-id <PROJECT_ID>

is producing the following error:
Unexpected token '??='

More info:

After installing locize-cli and running: locize, this is the error:

.../locize-cli/node_modules/undici/lib/core/util.js:623

  const listeners = (obj[kListeners] ??= [])

SyntaxError: Unexpected token '??='

Last working version

Worked up to version: 8.0.1

Stopped working in version: 8.0.1

To Reproduce

Having Node v14.21.3
Run: npx locize-cli download --format json --path <PATH> --api-key <API_KEY> --project-id <PROJECT_ID>

Expected behavior

The correct download of translations

Your Environment

  • runtime version: Node v14
  • os: Linux
@adrai
Copy link
Collaborator

adrai commented Aug 13, 2024

  1. Node v14 is outdated
  2. We don't use undici, but node-fetch here
  3. Not reproducible

@Endikaorve
Copy link
Author

Here is the dependency with undici:

─┬ android-string-resource@2.3.9
  └─┬ rdotjson@1.0.4
    └─┬ cheerio@1.0.0
      └── undici@6.19.7 

And it should be easily reproducible. It happens every time you run the command with Node version 14.

@adrai
Copy link
Collaborator

adrai commented Aug 13, 2024

Like said Node.js v14 is end of life since April 30, 2023
and seems cheerio v1.0.0 requires at least Node.js v18.17
There's not much we can do here....
Alternatively, use the locize-cli binary: https://github.com/locize/locize-cli/releases

@adrai
Copy link
Collaborator

adrai commented Aug 14, 2024

v8.0.2 should address this

@adrai adrai closed this as completed Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants