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

Does not work with key_value_json fileType #6

Open
monikaint opened this issue Mar 16, 2022 · 3 comments
Open

Does not work with key_value_json fileType #6

monikaint opened this issue Mar 16, 2022 · 3 comments

Comments

@monikaint
Copy link

Hi, i'm trying to use poeditor pull within my project, but I get an error. Could you help me?

My poeditor-config.json looks like this:

{
  "apiToken": "{API_TOKEN_HERE}",
  "projectId": {PROJECT_ID_HERE},
  "fileType": "key_value_json",
  "targetDir": "./src/locales"
}

When I try poeditor pull command in terminal, I get an error:

ErrorCaptureStackTrace(err);
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
    at Object.writeFileSync (node:fs:2159:5)
    at /opt/homebrew/lib/node_modules/poeditor/packages/commands/pull.js:106:8
    at Array.forEach (<anonymous>)
    at writeFiles (/opt/homebrew/lib/node_modules/poeditor/packages/commands/pull.js:94:9)
    at getTermFiles (/opt/homebrew/lib/node_modules/poeditor/packages/commands/pull.js:80:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Previously I have tried with "fileType": "json" and it worked correctly.

@Reggionick
Copy link
Contributor

I think that @TerenYeung hasn't published a new version with the latest fixes. Have you tried to reference the GitHub repository instead of the npm's latest version?

@monikaint
Copy link
Author

I have tried to installing poeditor-cli repository like this npm i https://github.com/TerenYeung/poeditor-cli.git, but I get the same error.

@TerenYeung
Copy link
Owner

TerenYeung commented May 19, 2022

@monikaint I'm sorry firstly, It's my fault as the lib is designed for apple_strings, android_strings and json in the begining. However, I describe not clearly in README and the usage of attention. Now, the cli only support apple_strings, android_strings and json to use apple_strings, android_strings, js or json as configuration to export .xml/.strings/.json .

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

3 participants