Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 导出的标识符"_“违约”;未在Babel'中声明;s范围跟踪器_Javascript_Typescript_Babeljs_Package.json - Fatal编程技术网

Javascript 导出的标识符"_“违约”;未在Babel'中声明;s范围跟踪器

Javascript 导出的标识符"_“违约”;未在Babel'中声明;s范围跟踪器,javascript,typescript,babeljs,package.json,Javascript,Typescript,Babeljs,Package.json,在升级到最新版本的TypeScript之后,我最近升级了babel配置。当我升级babel时,我现在得到了这个错误,我不知道为什么。以前有人遇到过这种情况吗?如果有,我如何修复它?决议是什么 The exported identifier "_default" is not declared in Babel's scope tracker as a JavaScript value binding, and "@babel/plugin-transform-typ

在升级到最新版本的TypeScript之后,我最近升级了babel配置。当我升级babel时,我现在得到了这个错误,我不知道为什么。以前有人遇到过这种情况吗?如果有,我如何修复它?决议是什么

The exported identifier "_default" is not declared in Babel's scope tracker
as a JavaScript value binding, and "@babel/plugin-transform-typescript"
never encountered it as a TypeScript type declaration.
It will be treated as a JavaScript value.

This problem is likely caused by another plugin injecting
"_default" without registering it in the scope tracker. If you are the author
 of that plugin, please use "scope.registerDeclaration(declarationPath)".
The exported identifier "_default" is not declared in Babel's scope tracker
as a JavaScript value binding, and "@babel/plugin-transform-typescript"
never encountered it as a TypeScript type declaration.
我的项目中的Babel依赖项:

    "@babel/core": "^7.13.8",
    "@babel/plugin-proposal-class-properties": "^7.13.0",
    "@babel/plugin-proposal-numeric-separator": "^7.12.13",
    "@babel/preset-env": "^7.13.8",
    "@babel/preset-react": "^7.12.13",
    "@babel/preset-typescript": "^7.13.0"

这个配置对我来说解决了同样的问题。把这个放进你的车里

{
  "presets": [
    ["@babel/preset-env", { "targets": { "node": 4 } }],
    "@babel/preset-typescript",
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-transform-runtime",
    "transform-class-properties"
  ]
}

为什么目标节点是4?它可以是更高的节点版本吗?