1

当运行 formatjs extract 这就是我们得到的。从堆栈跟踪看来,问题出在 formatjs 本身。感觉就像我被困在这里的问题所在。

$ formatjs extract './src/**/*.{js,ts,tsx}' --out-file './src/i18n/messages/messages.json' --extract-from-format-message-call --throws
Error: Debug Failure. Output generation failed
    at Object.transpileModule (/Users/.../node_modules/@formatjs/cli/node_modules/typescript/lib/typescript.js:126894:29)
    at processFile (/Users/.../node_modules/@formatjs/cli/src/extract.js:104:39)
    at /Users/.../node_modules/@formatjs/cli/src/extract.js:163:59
    at step (/Users/.../node_modules/@formatjs/cli/src/extract.js:44:23)
    at Object.next (/Users/.../node_modules/@formatjs/cli/src/extract.js:25:53)
    at fulfilled (/Users/.../node_modules/@formatjs/cli/src/extract.js:16:58)
error Command failed with exit code 1.
4

1 回答 1

0

您可能正在处理需要使用忽略的文件--ignore。您可以升级到最新版本并重新运行您的命令吗?长在此提交中添加了文件名https://github.com/formatjs/formatjs/commit/ceb0bf8a58c13fe6811bc35191018ee1c431484a

参考:https ://github.com/formatjs/formatjs/issues/2044

于 2020-11-24T17:22:34.770 回答