>node "C:\Users\jakub\AppData\Local\Yarn\Data\global\node_modules\.bin\\..\@tolgee\cli\dist\index.js" push ./src/**/*.ts?(x)
🔴 An unexpected error occurred while running the command.
🔴 Please report this to our issue tracker: https://github.com/tolgee/tolgee-cli/issues
TypeError: Cannot read properties of undefined (reading 'startsWith')
at loadProjectId (C:\Users\jakub\AppData\Local\Yarn\Data\global\node_modules\@tolgee\cli\dist\index.js:52:21)
at Object.preHandler [as callback] (C:\Users\jakub\AppData\Local\Yarn\Data\global\node_modules\@tolgee\cli\dist\index.js:79:9)
at async Command.parseAsync (C:\Users\jakub\AppData\Local\Yarn\Data\global\node_modules\commander\lib\command.js:935:5)
at async run (C:\Users\jakub\AppData\Local\Yarn\Data\global\node_modules\@tolgee\cli\dist\index.js:144:9)
Affected line is in function loadProjectId
function loadProjectId(cmd) {
const opts = cmd.optsWithGlobals();
if (opts.apiKey.startsWith(constants_1.API_KEY_PAK_PREFIX)) {
// Parse the key and ensure we can access the specified Project ID
const projectId = client_1.default.projectIdFromKey(opts.apiKey);
program.setOptionValue('projectId', projectId);
if (opts.projectId !== -1 && opts.projectId !== projectId) {
(0, logger_1.error)('The specified API key cannot be used to perform operations on the specified project.');
(0, logger_1.info)(`The API key you specified is tied to project #${projectId}, you tried to perform operations on project #${opts.projectId}.`);
(0, logger_1.info)('Learn more about how API keys in Tolgee work here: https://tolgee.io/platform/account_settings/api_keys_and_pat_tokens');
process.exit(1);
}
}
}
Environment:
Windows: 10 PRO
yarn: 1.22.5
node: v18.16.0
tolgee installed via yarn global
tolgee: 1.1.0
Exception
Affected line is in function
loadProjectId
Environment:
Steps
yarn global add @tolgee/cli
tolgee login <token with full admin>
tolgee push './src/**/*.ts?(x)'