错误指出:[错误]尚不支持将 const 转换为配置的目标环境(“es5”)
X [ERROR] Transforming const to the configured target environment ("es5") is not supported yet
gen/third_party/devtools-frontend/src/front_end/entrypoints/formatter_worker/FormatterActions.prebundle.ts:5:7:
5 Γöé export const enum FormatterActions {
Γò╡ ~~~~~
The target environment was set to "es5" here:
../../../tsconfig.json:10:14:
10 Γöé "target": "es5",
Γò╡ ~~~~~
X [ERROR] Transforming const to the configured target environment ("es5") is not supported yet
gen/third_party/devtools-frontend/src/front_end/entrypoints/formatter_worker/FormatterActions.prebundle.ts:13:7:
13 Γöé export const enum FormattableMediaTypes {
Γò╡ ~~~~~
The target environment was set to "es5" here:
../../../tsconfig.json:10:14:
10 Γöé "target": "es5",
Γò╡ ~~~~~
X [ERROR] Transforming const to the configured target environment ("es5") is not supported yet
gen/third_party/devtools-frontend/src/front_end/entrypoints/formatter_worker/FormatterActions.prebundle.ts:23:7:
23 Γöé export const FORMATTABLE_MEDIA_TYPES: string[] = [
Γò╡ ~~~~~
The target environment was set to "es5" here:
../../../tsconfig.json:10:14:
10 Γöé "target": "es5",
Γò╡ ~~~~~
X [ERROR] Transforming const to the configured target environment ("es5") is not supported yet
gen/third_party/devtools-frontend/src/front_end/entrypoints/formatter_worker/FormatterActions.prebundle.ts:43:7:
43 Γöé export const enum DefinitionKind {
Γò╡ ~~~~~
The target environment was set to "es5" here:
../../../tsconfig.json:10:14:
10 Γöé "target": "es5",
Γò╡ ~~~~~
[85/51950] CXX obj/third_party/flatbuffers/compiler_files/idl_parser.obj
ninja: build stopped: subcommand failed.
null
知道可能是什么原因吗?
附注实际构建基于 Brave,准确地说是版本 1.48.x - https://github.com/brave/brave-browser/tree/1.48.x 但无论如何,构建错误发生在 chrome 的代码中......
最佳答案
同时,我很幸运找到了答案,但很抱歉在这里提出了这个问题。
答案就在 GitHub 上的 Brave 问题中:https://github.com/brave/brave-browser/issues/21178
基本上在最顶层的 tsconfig.json 文件(包含 chrome src 文件夹的文件夹)中从 es5 更改为 esnext
关于chromium - 构建 chromium 110 时出错 - 将 const 转换为配置的目标环境 ("es5") 尚不受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75371886/