'Console error when trying to setup Vue Apollo client
I am trying to install Apollo on my Vue app.
I have created a fresh Vue install through npm init vue@latest and done a manual install of the Apollo client by following this guide:
https://apollo.vuejs.org/guide/installation.html#vue-cli-plugin
When I run my app I get the following error in the console:
Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=f3a89b0f' does not provide an export named 'default
My main.js file looks like this:
import App from "./App.vue";
import Vue from "vue";
import VueApollo from "vue-apollo";
import { createApp } from "vue";
import ApolloClient from "apollo-boost";
const apolloClient = new ApolloClient({
// You should use an absolute URL here
uri: "https://api.graphcms.com/simple/v1/awesomeTalksClone",
});
const apolloProvider = new VueApollo({
defaultClient: apolloClient,
});
new Vue({
el: "#app",
// inject apolloProvider here like vue-router or vuex
apolloProvider,
render: (h) => h(App),
});
Vue.use(VueApollo);
createApp(App).mount("#app");
I believe that I have followed the instructions as stated, but apparently I am doing something wrong?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
