【发布时间】:2019-06-30 09:14:14
【问题描述】:
我尝试使用webpack 4 将基于typescript 的应用程序构建为graphql 服务器。
但得到如下错误:
ERROR in ./node_modules/graphql/index.mjs 49:0-53:205
Can't reexport the named export 'BREAK' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
ERROR in ./node_modules/graphql/index.mjs 64:0-98:42
Can't reexport the named export 'BreakingChangeType' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
ERROR in ./node_modules/graphql/index.mjs 36:0-47:50
Can't reexport the named export 'DEFAULT_DEPRECATION_REASON' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
ERROR in ./node_modules/graphql/index.mjs 64:0-98:42
Can't reexport the named export 'DangerousChangeType' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
ERROR in ./node_modules/graphql/index.mjs 49:0-53:205
Can't reexport the named export 'DirectiveLocation' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
ERROR in ./node_modules/graphql/index.mjs 58:0-60:675
Can't reexport the named export 'FieldsOnCorrectTypeRule' from non EcmaScript module (only default export is available)
@ ./graphql/schema.ts
@ ./graphql/server.ts
.....
【问题讨论】:
-
我似乎在 SSR 模式下使用 Apollo Angular 时遇到了同样的问题。 @Edgaras Karka 你设法解决了吗?
标签: typescript webpack graphql webpack-4