nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
501 stars 114 forks source link

Unable to load the plugin, this.nuxt is undefined #589

Closed itwondersteam closed 1 year ago

itwondersteam commented 1 year ago

Version

@nuxtjs/sentry: nuxt:

Sentry configuration

    modules: [
        '@nuxtjs/sentry',
    ],
    sentry: {
        dsn: process.env.NUXT_SENTRY_DSN
    },

Reproduction Link

repo

Steps to reproduce

pnpm add @nuxtjs/sentry

update config

export default defineNuxtConfig({
  devtools: { enabled: true },
  modules: [
    '@nuxtjs/sentry'
  ],
  sentry: {
    dsn: process.env.NUXT_SENTRY_DSN, // Enter your project's DSN.
  }
})

What is Expected?

Able to install the sentry plugin successfully.

What is actually happening?

 ERROR  Cannot start nuxt:  Cannot read properties of undefined (reading 'nuxt')                                                                

  at normalizedModule (node_modules/.pnpm/@nuxtjs+sentry@8.0.0-beta.10_vue@3.3.4/node_modules/@nuxtjs/sentry/dist/module.mjs:54:19)
  at installModule (node_modules/.pnpm/@nuxt+kit@3.6.1/node_modules/@nuxt/kit/dist/index.mjs:2409:101)
  at async initNuxt (node_modules/.pnpm/nuxt@3.6.1_@types+node@18.16.19/node_modules/nuxt/dist/index.mjs:3174:7)
  at async load (node_modules/.pnpm/nuxi@3.6.1/node_modules/nuxi/dist/chunks/dev.mjs:204:9)
  at async Object.invoke (node_modules/.pnpm/nuxi@3.6.1/node_modules/nuxi/dist/chunks/dev.mjs:248:5)
  at async _main (node_modules/.pnpm/nuxi@3.6.1/node_modules/nuxi/dist/cli.mjs:48:20)
rchl commented 1 year ago

There is no Nuxt 3 version of this module. See https://github.com/nuxt-community/sentry-module/issues/530