question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

help: Using onGlobalSetup from custom nuxt module

See original GitHub issue

šŸ“š What are you trying to do? Please describe. I’m currently developing a Nuxt module for the Villus GraphQL client and when trying to add support for @nuxtjs/composition-api I run into the following error (the call stack indicates this is coming from onGlobalSetup):

Cannot read property 'add' of undefined

šŸ” What have you tried? I tried mashing my keyboard with a wooden spoon to make it work but it didn’t work 😐

ā„¹ļø Additional context The plugin provided by the Nuxt module is transpiled from TypeScript. @nuxtjs/composition-api is listed both in peerDependencies and devDependencies on the module side of things. I’m testing the module inside a local project using yarn link nuxt-villus but I also tried releasing the module and using it as a normal dependency to no avail.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danielroecommented, Mar 23, 2021

@lewebsimple (Should be fixed in any case with v0.22.4.)

1reaction
danielroecommented, Mar 23, 2021

@lewebsimple Check what Node version you are using.

Read more comments on GitHub >

github_iconTop Results From Across the Web

onGlobalSetup - Nuxt Composition API
You can run functions (or provide data) in the global Nuxt setup() function. This helper will run a callback function in the global...
Read more >
Usage nuxt composition api and nuxt appollo module
import { Context } from '@nuxt/types' import { onGlobalSetup, ... will connect @nuxt/apollojs with @vue/apollo-composable */ export defaultĀ ...
Read more >
How to create a global custom plugin in Nuxt.js
In this tutorial, we'll cover two different options to build our own custom plugin, using both Vue and JavaScript. As an example, our...
Read more >
Module Author Guide Ā· Nuxt Advanced
Using Nuxt Modules, we can encapsulate, properly test and share custom solutions as npm packages without adding unnecessary boilerplate to the Nuxt projectĀ ......
Read more >
Usage nuxt composition api and nuxt appollo module-Vue.js
import { Context } from '@nuxt/types' import { onGlobalSetup, ... This plugin will connect @nuxt/apollojs with @vue/apollo-composable */ export defaultĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found