vue-async-function
vue-async-function copied to clipboard
Problems with using in Nuxtjs
The ideas in this library is great, but I have spent more than a day trying to get it running in a Nuxt application (nuxtjs.org)
My sample application where it fails is here: https://github.com/sbglasius/nuxt-composition-async-function
Steps performed:
Create a Nuxt application,
npx create-nuxt-app
add Typescript support: https://typescript.nuxtjs.org/guide/setup.html#installation
add composition support + vue-async-function:
npm install --save @vue/composition-api vue-async-function
and create a plugin in plugins/composition.ts
, adding it to nuxt.config.js
Then following the typescript examples, adding code to pages/index.vue
Unfortunately I'm too much of a noob in the VueJS/NuxtJS world to see my way through what is wrong. I hope you can help. Thank you in advance.
I've not used Nuxt before so I'm not sure if I can help. I can give it a try, but I'm a bit limited on time currently.
Allright, tried to follow above steps and saw that Nuxt is still on core-js 2.x while I just upgraded vue-async-function to core-js 3.x. Also, @vue/composition-api
doesn't support SSR yet so it breaks universal mode.
So, to fix this you need to change two things:
- Set mode to
spa
innuxt.config.js
- Install [email protected] for core-js 2.x support.
I'll keep this issue open until I hear from you.