AlbertBrand / vue-async-function

Vue Async Function
81 stars 4 forks source link

Problems with using in Nuxtjs #5

Open sbglasius opened 4 years ago

sbglasius commented 4 years ago

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.

AlbertBrand commented 4 years ago

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.

AlbertBrand commented 4 years ago

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:

I'll keep this issue open until I hear from you.