Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.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
Typescript Babel编译类型脚本exportDefaultFrom错误_Typescript_Babeljs - Fatal编程技术网

Typescript Babel编译类型脚本exportDefaultFrom错误

Typescript Babel编译类型脚本exportDefaultFrom错误,typescript,babeljs,Typescript,Babeljs,我使用Babel编译Typescript代码时遇到以下错误: { SyntaxError: ....../node_modules/@apollographql/apollo-tools/lib/buildServiceDefinition.d.ts: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (3:8): 1 | import { GraphQLSchema, Docum

我使用Babel编译Typescript代码时遇到以下错误:

{ SyntaxError: ....../node_modules/@apollographql/apollo-tools/lib/buildServiceDefinition.d.ts: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (3:8):

  1 | import { GraphQLSchema, DocumentNode, GraphQLError } from "graphql";
  2 | import { GraphQLResolverMap } from "./schema/resolverMap";
> 3 | export interface GraphQLSchemaModule {
    |        ^
  4 |     typeDefs: DocumentNode;
  5 |     resolvers?: GraphQLResolverMap<any>;
  6 | }

Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.
但是,错误仍然存在。有什么建议吗

谢谢

{
  "presets": [
      "@babel/env",
      "@babel/typescript"
  ],
  "plugins": [
      "@babel/proposal-class-properties",
      "@babel/proposal-object-rest-spread",
      "@babel/plugin-proposal-export-default-from",
      "@babel/plugin-proposal-export-namespace-from"
  ]
}