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

Node 16 not supported #149

Closed
jashment opened this issue Feb 16, 2022 · 2 comments · Fixed by #150
Closed

Node 16 not supported #149

jashment opened this issue Feb 16, 2022 · 2 comments · Fixed by #150

Comments

@jashment
Copy link
Contributor

🐛 Bug Report

This package does not work with Node version 16.

To Reproduce

  1. Set node environment to v16
  2. Create a simple po file:
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"mime-version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"POT-Creation-Date: 2022-02-04T22:13:20.856Z\n"
"PO-Revision-Date: 2022-02-04T22:13:20.856Z\n"
"Language: en\n"

msgid "This is a string"
msgstr "This is a string"
  1. Use i18next-conv with the following command:
i18next-conv -l en -s en.po -t out.json
  1. The conversion will say "file written" in green. If you try to find out.json, it will not exist.

Expected behavior

Expect the conversion to work and out.json with the translated strings.

Your Environment

  • runtime version: node v16
  • i18next version: 21.6.0
  • os: Mac

Additional Details

With a little digging, found that in Node 16 it is due to this particular line:

i18next-conv/bin/index.js:157:9 
{
  code: ‘ERR_INVALID_CALLBACK’
}

mkdir requires a callback, which is not supplied.

In the package.json it states that supported node versions are node >= 12.2.

Alternative could be to state in the package.json that only node version 12.2 is supported.

@perrin4869
Copy link
Contributor

Oh so sorry, somehow that escaped me! That's a mistake, it should be mkdirSync instead. I will fix this, thanks for the report!

@perrin4869
Copy link
Contributor

Released in v12.0.1

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

Successfully merging a pull request may close this issue.

2 participants