nuxt-community / sentry-module

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

Version 2.7.5 breaks in nuxt 2.16.3 #570

Closed fabiiomiiguel closed 1 year ago

fabiiomiiguel commented 1 year ago

Version

@nuxtjs/sentry: 7.2.5 nuxt: 2.16.3

Sentry configuration

Reproduction Link

 Nuxt instance is unavailable!

  at useNuxt (node_modules/@nuxtjs/sentry/dist/module.mjs:18:11)
  at getOptions (node_modules/@nuxtjs/sentry/dist/module.mjs:47:18)
  at ModuleContainer.normalizedModule (node_modules/@nuxtjs/sentry/dist/module.mjs:64:28)
  at node_modules/@nuxtjs/sentry/dist/module.cjs:2:53
  at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:167:20)
  at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:36:5)
  at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:342:5)

   ╭──────────────────────────────────────────╮
   │                                          │
   │   ✖ Nuxt Fatal Error                     │
   │                                          │
   │   Error: Nuxt instance is unavailable!   │
   │                                          │
   ╰──────────────────────────────────────────╯

Steps to reproduce

Upgrade from 7.2.3 for 7.2.5 and run npm run dev.

What is Expected?

Run without break like in the previous version.

What is actually happening?

Breaking the development mode.

rchl commented 1 year ago

Do you have nuxt kit in your project? npm why @nuxt/kit?

rchl commented 1 year ago

I don't know how to reproduce but I have a hunch what it could be caused by. I've made potential fix in https://github.com/nuxt-community/sentry-module/pull/571

You could try to apply this change manually to node_modules/@nuxtjs/sentry/dist/module.mjs and see if it helps.

fabiiomiiguel commented 1 year ago

Yes that fix works! Thank you!