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

fix: undefined injectedGlobalOptions close #182 #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LuXDAmore
Copy link

fix: undefined injectedGlobalOptions close #182

fix: undefined injectedGlobalOptions close AttoJS#182
@John60676
Copy link
Member

Can you provide a reproducible example?

@LuXDAmore
Copy link
Author

@John60676 So, I don't know exactly how to reproduce it and probably it's not a problem of vue-request..
After digging I've found that is related to Nuxt and to this bug

Because moving the usePagination() BEFORE the await useAsyncData() fix the problem.

So i think in some ways the inject lose its context after the await so the undefined injectedGlobalOptions error appear in the console and is annoying.

@neostfox
Copy link

neostfox commented May 9, 2024

when usePagination used in typescript or JavaScript, inject will return undefined。

@neostfox
Copy link

neostfox commented May 9, 2024

I think use renderless component is much better than provide/inject

@sugionosihuahua
Copy link

@LuXDAmore @John60676 @neostfox , so everyone? how to fix this? i have this problem when implementing ant-design-vue ajax table in vue js and i can't found any related post/thread except this

@LuXDAmore
Copy link
Author

@sugionosihuahua for me the solution was to move the usePagination() BEFORE every others await used in the component.

@sugionosihuahua
Copy link

@LuXDAmore thx for the reply, however in my case this happened because i put data result inside another array in the backend response (same as documentation in the ant-design-vue table, they put data in the "results" key).
so now i can do just fine.

@code-lixm
Copy link

i also meet the problem, plz merge the pr

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

Successfully merging this pull request may close these issues.

[Bug Report] undefined injectedGlobalOptions
5 participants