-
Notifications
You must be signed in to change notification settings - Fork 100
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: Cannot read property 'add' of undefined at onGlobalSetup #488
Comments
@JoeyYoung1997 Would you provide a reproduction? 🙏 |
I got the same error. Chrome:
Firefox:
|
Same issue here,
While calling
|
Would you provide a reproduction so I can check this out? |
Hi @danielroe, Thank you for your prompt response, following is a reproduction: https://codesandbox.io/s/goofy-night-t2sr6 The error occurs in
|
Calling import { provide, onGlobalSetup, globalPlugin } from '@nuxtjs/composition-api'
const myPlugin: Plugin = function (context, inject) {
globalPlugin(context, inject)
onGlobalSetup(() => {
provide(...)
})
} |
This should be fixed in |
🐛 The bug
What isn't working? Describe what the bug is.
I found out after debugger, "const onGlobalSetup =(fn)=> {globalSetup.add(fn);};", in this code, globalSetup has not yet been assigned in the globalPlugin function
code show as below:
export default ({ app, store }, inject) => {
onGlobalSetup(() => {
inject('navigateTo', func)
})
}
The text was updated successfully, but these errors were encountered: