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

[vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function. #18

Closed
antlionguard opened this issue Mar 25, 2022 · 23 comments · Fixed by nuxt/framework#3906
Assignees
Labels
bridge bug Something isn't working upstream

Comments

@antlionguard
Copy link

antlionguard commented Mar 25, 2022

Sorry for wrongly opened issue. I cannot edit labels. This issue related with bridge 🙏

@antlionguard Thanks - following up with a PR on that mixin: nuxt/framework#3900.

There's something broke after this PR. I got this error in my all pages.

resim

_Originally posted by @antlionguard in #94

@antlionguard
Copy link
Author

This error still exist after nuxt/framework#3906. Am i doing something wrong @danielroe? Sorry for a lot of interruptions 🙏

resim

@danielroe
Copy link
Member

danielroe commented Mar 25, 2022

It looks like I need a reproduction 🙏

@danielroe danielroe added needs reproduction and removed bug Something isn't working labels Mar 25, 2022
@danielroe danielroe reopened this Mar 25, 2022
@antlionguard
Copy link
Author

antlionguard commented Mar 25, 2022

It looks like I need a reproduction 🙏

i cannot reproduce but i found where the problem is came from.

i closed the pinia from build modules
resim

and there's no error here. i think @posva can help us for this? @danielroe

@Luferov
Copy link
Contributor

Luferov commented Mar 27, 2022

It looks like I need a reproduction pray

https://github.com/devind-team/eleden

cd client
yarn
yarn run dev

@Luferov
Copy link
Contributor

Luferov commented Mar 29, 2022

Completely impossible to work because of this error :(

@antlionguard
Copy link
Author

Completely impossible to work because of this error :(

yes same for me. i installed old version. @danielroe any update for this error?

@Luferov
Copy link
Contributor

Luferov commented Mar 31, 2022

I created a simple project with nuxt-bridge & nuxt/pinia. https://github.com/Luferov/bea. Maybe the problem is not in nuxt-bridge, but in pinia/nuxt? @danielroe is it possible?
Although it worked before.

@antlionguard
Copy link
Author

antlionguard commented Mar 31, 2022

I created a simple project with nuxt-bridge & nuxt/pinia. https://github.com/Luferov/bea. Maybe the problem is not in nuxt-bridge, but in pinia/nuxt? @danielroe is it possible? Although it worked before.

i think it's possible. but this error occurs after nuxt/framework#3900. and nuxt/framework#3900 resolves #94. btw @pinia/nuxt didn't get any updates at a close time.

@Luferov
Copy link
Contributor

Luferov commented Mar 31, 2022

Ok, with nuxt3 it`s wokr fine.

@danielroe
Copy link
Member

This will likely be resolved with vuejs/pinia#791.

For now I think you can work around this with:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  modules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

Let me know if that doesn't work.

@antlionguard
Copy link
Author

antlionguard commented Apr 1, 2022

This will likely be resolved with vuejs/pinia#791.

For now I think you can work around this with:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  modules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

Let me know if that doesn't work.

that's not worked. :(

But somethings it weird now. I tried on workarounding at any page. I didn't get this error if i remove all nuxt things(like useLazyAsyncData, auto imported composables and pinia stores). If i use any one of these i got error again.

image

@danielroe danielroe added bug Something isn't working upstream and removed needs reproduction pending triage labels Apr 1, 2022
@Luferov
Copy link
Contributor

Luferov commented Apr 1, 2022

Unfortunately, the same effect :( I do commit to reproduction https://github.com/Luferov/bea.

@Luferov
Copy link
Contributor

Luferov commented Apr 1, 2022

And got this warning brefore this error, @danielroe should I create a new issue or not about this or not?
image

@danielroe
Copy link
Member

@Luferov Yes, it's a different issue. However I think that you just need to ensure you're on the latest version of unimport. (If that doesn't resolve it, then do raise a new issue.)

@NidMo
Copy link

NidMo commented Apr 2, 2022

@Luferov Yes, it's a different issue. However I think that you just need to ensure you're on the latest version of unimport. (If that doesn't resolve it, then do raise a new issue.)

I wonder if you have solved this problem, because I seem to have the same problem

image

@Luferov
Copy link
Contributor

Luferov commented Apr 19, 2022

@antlionguard Could you try to do like that?

image

@antlionguard
Copy link
Author

@antlionguard Could you try to do like that?

image

Is this a plugin? If so, did you import it in "plugins" inside the nuxt.confg?

I'm asking to confirm if I understood correctly.

@Luferov
Copy link
Contributor

Luferov commented Apr 19, 2022

@antlionguard Could you try to do like that?
image

Is this a plugin? If so, did you import it in "plugins" inside the nuxt.confg?

I'm asking to confirm if I understood correctly.

When I fixed all other issues, unfortunately this error reappeared. :( very sad

@antlionguard
Copy link
Author

nuxt app instance unavailable error gone after the new updates. But [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function. error still exist all pinia used pages.

@antlionguard antlionguard changed the title nuxt app instance unavailable error on all pages [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function. Apr 21, 2022
@Luferov
Copy link
Contributor

Luferov commented Apr 21, 2022

nuxt app instance unavailable error gone after the new updates. But [vue-composition-api] must call Vue.use(VueCompositionAPI) before using any function. error still exist all pinia used pages.

I think the whole team is focused on nuxt3. May need to wait a bit.

@antlionguard
Copy link
Author

antlionguard commented Apr 27, 2022

I work around with transpile after new updates. And pinia now working. @Luferov

with this:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  buildModules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

But there's another nuxt instance unavaliable error appears. I will create another issue for new error.

@Luferov
Copy link
Contributor

Luferov commented Apr 27, 2022

I work around with transpile after new updates. And pinia now working. @Luferov

with this:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  buildModules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

But there's another nuxt instance unavaliable error appears. I will create another issue for new error.

Forward to another problems.))

@antlionguard
Copy link
Author

I work around with transpile after new updates. And pinia now working. @Luferov
with this:

import { defineNuxtConfig } from '@nuxt/bridge'

export default defineNuxtConfig({
  buildModules: ['@pinia/nuxt'],
  build: {
    transpile: ['pinia'],
  },
})

But there's another nuxt instance unavaliable error appears. I will create another issue for new error.

Forward to another problems.))

The new problem related with directly nuxt-bridge. I got the error on nuxt context used pages like "ref, computed, useNuxtApp".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge bug Something isn't working upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants