You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: Deno 2.1.5 on GitHub Actions (runs-on: ubuntu-latest)
yargs v17.7.2-deno
When I run a simple yargs-based CLI that has a positional, Deno 2.1.5 tries to load the locale file as a local path /x/[email protected]/locales/en.json (or C.json if no locale sent) and fails with:
error: Uncaught (in promise) TypeError: Cannot assign to read only property 'code' of object 'NotFound: No such file or directory (os error 2): readfile '/x/[email protected]/locales/en.json''
err.code = 'ENOENT'
^
at Object.readFileSync (https://deno.land/x/[email protected]/lib/platform-shims/deno.ts:13:17)
at Y18N._readLocaleFile (https://deno.land/x/[email protected]/build/lib/index.js:133:47)
at Y18N.__ (https://deno.land/x/[email protected]/build/lib/index.js:24:18)
at Object.self.getPositionalGroupName (https://deno.land/x/[email protected]/build/lib/usage.js:92:16)
at YargsInstance.positional (https://deno.land/x/[email protected]/build/lib/yargs-factory.js:805:81)
Example code:
import yargs from "https://deno.land/x/[email protected]/deno.ts";
yargs(Deno.args)
.locale("en")
.scriptName("my name")
.strict()
.option("verbose", { alias: "v", type: "boolean" })
.command(/* ... */)
.positional("function-name", {
string: true,
describe: "the name of the function",
})
.parse();
Version: Deno 2.1.5 on GitHub Actions (runs-on: ubuntu-latest)
When I run a simple yargs-based CLI that has a positional, Deno 2.1.5 tries to load the locale file as a local path
/x/[email protected]/locales/en.json
(or C.json if no locale sent) and fails with:Example code:
Workaround
Pinning Deno to 2.1.4 in the workflow:
resolves the issue—no changes to the code required. In 2.1.4 works even without
.locale("en")
.The text was updated successfully, but these errors were encountered: