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

@lingui/cli dependancy cli-table when using 0.3.7 breaks extract #1169

Closed
lukehowkins opened this issue Nov 19, 2021 · 5 comments
Closed

@lingui/cli dependancy cli-table when using 0.3.7 breaks extract #1169

lukehowkins opened this issue Nov 19, 2021 · 5 comments

Comments

@lukehowkins
Copy link

Describe the bug
getting error:

node_modules/cli-table/lib/utils.js:85
  var split = stripped.split("\n");

TypeError: stripped.split is not a function

To Reproduce
run lingui extract

Expected behavior
to extract without error

Additional context
Automattic/cli-table#152

  • jsLingui version 3.12.1
  • Babel version 7.16.0

Workaround
Have added "cli-table": "0.3.6", in my project dev-dependancy

@drod66
Copy link

drod66 commented Nov 21, 2021

EDIT: Using cli-table v0.3.6 didn't fixed it for me.

I did a quick test locally and returning strings in stats.js getStats() did fixed it:

type CatalogStats = [string, string]

export function getStats(catalog: CatalogType): CatalogStats {
  return [
    Object.keys(catalog).length.toString(),
    Object.keys(catalog).filter((key) => !catalog[key].translation).length.toString(),
  ]
}

@callms
Copy link
Contributor

callms commented Nov 23, 2021

For those having this issue and using npm, you should pin the version 0.3.6 of cli-table in your package-lock.json

  1. edit the file, and locate the section @lingui/cli
  2. remove the cli-table key in requires
  3. add the following object in dependancies:
"cli-table": {
  "version": "0.3.6"
},

In the meantime I also submitted #1172 if the maintainers here would like to take a precautionary action (essentially preventing every new installations of @lingui/cli from being broken at this time)

@dmitryshelomanov
Copy link

same error

@semoal
Copy link
Contributor

semoal commented Nov 24, 2021

Hi guys, we'll take care of this (and the other issues/discussions) asap this week. Sorry for the inconveniences.

@semoal
Copy link
Contributor

semoal commented Nov 27, 2021

Fixed this on latest version. 3.13.0.

@semoal semoal closed this as completed Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants