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

Browser Console Error: Uncaught ReferenceError: defineNuxtPlugin is not defined #3

Closed
modbender opened this issue Mar 16, 2023 · 4 comments

Comments

@modbender
Copy link

modbender commented Mar 16, 2023

Environment


  • Operating System: Windows_NT
  • Node Version: v16.18.1
  • Nuxt Version: 3.2.3
  • Nitro Version: 2.3.1
  • Package Manager: yarn@1.22.17
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

export default defineNuxtConfig({
  modules: ['nuxt-gtag'],

  gtag: {
    id: 'G-XXXXXXXXXX'
  }
})

Describe the bug

GTag doesn't work. On browser console I see this error:

Uncaught ReferenceError: defineNuxtPlugin is not defined
at plugin.client.mjs?v=54cefaf0:1:1

You should probably add this to plugin.client.ts

import { defineNuxtPlugin, useRuntimeConfig } from "#app";

Additional context

No response

Logs

No response

@johannschopplich
Copy link
Owner

Oh snap. 🙈 Thanks for reporting!

@modbender
Copy link
Author

modbender commented Mar 16, 2023

@johannschopplich also missing in composable:
https://github.com/johannschopplich/nuxt-gtag/blob/main/src/runtime/composables/useGtag.ts

Uncaught (in promise) ReferenceError: useNuxtApp is not defined.

@johannschopplich
Copy link
Owner

johannschopplich commented Mar 16, 2023

That's the same problem. Somehow didn't happen during playground testing... Will fix it asap. Thanks for testing!

@johannschopplich
Copy link
Owner

Fixed in e09a1e5.

Please use v0.2.2 – should be deployed in a minute. 🙂

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