【问题标题】:Can't reexport the named export 'Name of the module' node_modules/graphql/index.mjs => Vue CLI 3 + Apollo无法重新导出命名导出“模块名称”node_modules/graphql/index.mjs => Vue CLI 3 + Apollo
【发布时间】:2019-04-29 01:39:29
【问题描述】:

const apolloProvider = new VueApollo({ defaultClient })

Vue.config.productionTip = false

new Vue({
  provide: apolloProvider.provide(),
  router,
  store,
  render: h => h(App)
}).$mount('#app')

当我将 ApolloBoost 集成到我的 Vue CLI 3 时遇到问题。它在 ../node_modules/graphql/ 中显示“无法从非 EcmaScript 模块重新导出命名导出 'visitInParallel'(仅默认导出可用)错误” index.mjs"

以下是我尝试过的不同方法:
1.我尝试配置vue.config.js
2.使用节点--experimental-module ../node_modules/graphql/index.mjs

难怪它为什么不起作用。

【问题讨论】:

    标签: vue.js graphql apollo


    【解决方案1】:

    我解决这个问题的方法是安装 vue-cli-plugin-apollo

    npm install vue-cli-plugin-apollo
    or
    yarn add vue-cli-plugin-apollo
    

    也许 vue-cli 需要 vue-cli-plugin-apollo 才能使用 vue-apollo。

    【讨论】:

      猜你喜欢
      • 2019-06-30
      • 2021-10-17
      • 1970-01-01
      • 2022-06-25
      • 2020-01-19
      • 2021-08-24
      • 2022-06-15
      • 2019-09-24
      • 2018-02-21
      相关资源
      最近更新 更多