Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with using in Nuxtjs #5

Open
sbglasius opened this issue Nov 19, 2019 · 2 comments
Open

Problems with using in Nuxtjs #5

sbglasius opened this issue Nov 19, 2019 · 2 comments

Comments

@sbglasius
Copy link

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
Copy link
Owner

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
Copy link
Owner

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 in nuxt.config.js
  • Install vue-async-function@2.0.2 for core-js 2.x support.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants