question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong JSON structure in `...\node_modules\yargs\locales\cs.json` during a migration process

See original GitHub issue

Current Behavior

Running the nx migrate latest (or any other with a concrete version) command leads to a runtime error (Windows 10 with Czech locale set). I already created a PR in the yargs package for it: https://github.com/yargs/yargs/pull/2242

SyntaxError: syntax error in C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\locales\cs.json
    at JSON.parse (<anonymous>)
    at Y18N._readLocaleFile (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\y18n\build\index.cjs:141:37)
    at Y18N.__ (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\y18n\build\index.cjs:30:18)
    at Object.P.n.getPositionalGroupName (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\build\index.cjs:1:14322)
    at Xt.positional (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\build\index.cjs:1:41613)
    at withMigrationOptions (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\nx\src\command-line\nx-commands.js:644:10)
    at C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\nx\src\command-line\nx-commands.js:247:64
    at M.applyBuilderUpdateUsageAndParse (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\build\index.cjs:1:7384)
    at M.runCommand (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\build\index.cjs:1:7078)
    at Xt.[runYargsParserAndExecuteCommands] (C:\Temp\tmp-26860-zE27hc4eyGFz\node_modules\yargs\build\index.cjs:1:57900)

When checking the file cs.json, it’s clear that there is a mistake in the JSON structure on line 18 ("other": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s",), where an extra comma is placed at the end of the line. Other locale files (like en.json, …) don’t have this mistake.

Expected Behavior

Valid JSON structure of the cs.json file.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nexdrewcommented, Nov 2, 2022

It’s published as latest now, so you should be good to go with upgrading the yargs dependency.

0reactions
mlc-mlapiscommented, Nov 2, 2022

@nexdrew I hope so. I didn’t check. 💡

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solve common issues with JSON in SQL Server
Answer. You can create any data structure by adding FOR JSON queries as column expressions that return JSON text. You can also create...
Read more >
I've received an "Invalid JSON string" error. What do I do?
An invalid JSON error can occur for many reasons. The most common issue is usually associated with a file upload attempt, and can...
Read more >
Working with JSON - Learn web development | MDN
JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax.
Read more >
JSON Files - Spark 3.3.1 Documentation
Property Name Default Scope primitivesAsString false read prefersDecimal false read allowComments false read
Read more >
Resolve JSON errors in Amazon Athena
When I try to read JSON data in Amazon Athena, I receive NULL or incorrect data errors. Resolution. Check the following common issues:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found