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

Plan for Nuxt 3 version #530

Closed
5 tasks
rchl opened this issue Mar 24, 2023 · 46 comments
Closed
5 tasks

Plan for Nuxt 3 version #530

rchl opened this issue Mar 24, 2023 · 46 comments
Assignees

Comments

@rchl
Copy link
Member

rchl commented Mar 24, 2023

The module's code was refactored in #456 and now largely follows a structure of a Nuxt 3 module (using defineModule and all) but note that it's not using @nuxt/kit but instead a "homemade" shim that has similar (same?) methods. This should make it easy to transition to the real @nuxt/kit for Nuxt 3.

The plan is for the Nuxt 3 version to live on its own branch and have higher major version (we can skip 2 versions or so to give some space for the Nuxt 2 version to introduce breaking changes). Attempts at making a version compatible with both Nuxt 2 and Nuxt 3 were futile so this is how it has to be. Alternatively, a monorepo with both versions sounds like a viable alternative but those would have to not share dependencies so not sure if that would work (I'm not too familiar with the current monorepo solutions).

When implementing the new version, those are some challenges that I foresee:

  • Supporting Nitro and making Sentry available on the server side (in non-webpack/non-vite context). Current version exposes sentry on process.sentry which is a bit of a hack to make Sentry available globally and to avoid reinitializing it on every server side page load. This is to also to allow use of Sentry even outside of specific server routes. If there are better ways to do it in Nuxt 3 then we can try that, even if it would be a breaking change. Important: ensure that Sentry is initialized early in a global server context. It would likely not be enough to do from a middleware and require some request to run first.
  • Supporting publishing releases in Vite environment. Currently we are using the official webpack plugin to handle that. We would also need to support Vite. Looks like there is official support ready for Vite now in https://github.com/getsentry/sentry-javascript-bundler-plugins
  • Supporting tracing functionality. Part of the functionality uses connect/express middleware to instrument tracing of routes. Make sure that still works.
  • Adding the Vue composition APIs. Currently lacking.
  • Sentry express/connect middleware handlers (https://docs.sentry.io/platforms/node/guides/express/) have a bunch of logic for detecting transactions, session tracking and more. Not sure if h3 is compatible with those. If not then maybe those have to be adapted for Nuxt 3 version.

I'm open for contributors to tackle this. Since I'm not using Nuxt 3 at the moment, I don't have that much incentive or time to work on it myself.

@proalaa
Copy link

proalaa commented May 26, 2023

any updates here guys

@darthf1
Copy link

darthf1 commented May 31, 2023

The below is what I currently have. It uses @sentry/vite-plugin, which should tick the second box. The below is most definitely not on par wit the current Nuxt 2 module, and the code is absolutely not battle tested. But maybe it can be used as a starting point.

~/nuxt.config.ts:

import { sentryVitePlugin } from '@sentry/vite-plugin'
import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
  ssr: false, // I have SSR false

  runtimeConfig: {
    public: {
      ENV: process.env.NODE_ENV ?? 'production',
      SENTRY_ENABLED: process.env.NUXT_PUBLIC_SENTRY_ENABLED,
      SENTRY_DSN: process.env.NUXT_PUBLIC_SENTRY_DSN,
      SENTRY_ENVIRONMENT: process.env.NUXT_PUBLIC_.SENTRY_ENVIRONMENT,
      SENTRY_RELEASE: process.env.NUXT_PUBLIC_SENTRY_RELEASE,
      SENTRY_TRACE_PROPAGATION_TARGET: process.env.NUXT_PUBLIC_SENTRY_TRACE_PROPAGATION_TARGET,
    },
  },

  sourcemap: {
    server: true,
    client: true,
  },

  vite: {
    build: {
      sourcemap: true,
    },
    plugins: [
      sentryVitePlugin({
          authToken: process.env.NUXT_PUBLIC_SENTRY_AUTH_TOKEN,
          debug: true,
          org: process.env.NUXT_PUBLIC_SENTRY_ORG,
          project: process.env.NUXT_PUBLIC_SENTRY_PROJECT,
          release: {
            name: process.env.NUXT_PUBLIC_SENTRY_RELEASE,
          },
          sourcemaps: {
            assets: ['./.nuxt/dist/client/**'],
          },
          telemetry: false,
        }),
    ],
  },
})

~/plugins/sentry.client.ts:

import {
  HttpClient as HttpClientIntegration,
  ReportingObserver as ReportingObserverIntegration,
} from '@sentry/integrations'
import type { Breadcrumb, CaptureContext, Primitive, User } from '@sentry/types'
import * as Sentry from '@sentry/vue'
import { withScope } from '@sentry/vue'
import type { Router } from 'vue-router'
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin({
  parallel: true,
  setup: (nuxtApp) => {
    if (
      typeof window === 'undefined' ||
      !['true', true].includes(nuxtApp.$config.public.SENTRY_ENABLED)
    ) {
      return {
        provide: {
          sentrySetContext: (
            _name: string,
            _context: {
              [key: string]: any
            } | null,
          ) => {},
          sentrySetUser: (_user: User | null) => {},
          sentrySetTag: (_key: string, _value: Primitive) => {},
          sentryAddBreadcrumb: (_breadcrumb: Breadcrumb) => {},
          sentryCaptureException: (_exception: any, _captureContext?: CaptureContext) => {},
        },
      }
    }

    Sentry.init({
      app: nuxtApp.vueApp,
      autoSessionTracking: true,
      dsn: nuxtApp.$config.public.SENTRY_DSN,
      release: nuxtApp.$config.public.SENTRY_RELEASE,
      environment: nuxtApp.$config.public.SENTRY_ENVIRONMENT,
      integrations: [
        new Sentry.BrowserTracing({
          routingInstrumentation: Sentry.vueRouterInstrumentation(nuxtApp.$router as Router, {
            routeLabel: 'path',
          }),
        }),
        new Sentry.Replay({
          networkDetailAllowUrls: [`https//${nuxtApp.$config.public.HOST_NAME}`],
        }),
        new HttpClientIntegration(),
        new ReportingObserverIntegration(),
      ],
      tracePropagationTargets: [nuxtApp.$config.public.SENTRY_TRACE_PROPAGATION_TARGET],
      trackComponents: true,
      hooks: ['activate', 'create', 'destroy', 'mount', 'update'],
      // Set tracesSampleRate to 1.0 to capture 100%
      // of transactions for performance monitoring.
      // We recommend adjusting this value in production
      tracesSampleRate: 0.2,

      // Capture Replay for 10% of all sessions,
      // plus for 100% of sessions with an error
      replaysSessionSampleRate: 0.1,
      replaysOnErrorSampleRate: 1,
    })

    nuxtApp.vueApp.config.errorHandler = (err, context) => {
      withScope((scope) => {
        scope.setExtra('context', context)
        Sentry.captureException(err)
      })
    }

    nuxtApp.hook('app:error', (err) => {
      Sentry.captureException(err)
    })

    return {
      provide: {
        sentrySetContext: Sentry.setContext,
        sentrySetUser: Sentry.setUser,
        sentrySetTag: Sentry.setTag,
        sentryAddBreadcrumb: Sentry.addBreadcrumb,
        sentryCaptureException: Sentry.captureException,
      },
    }
  },
})

@kostia7alania

This comment was marked as off-topic.

@hvegav
Copy link

hvegav commented Jul 1, 2023

sourcemap are not working with the abobe configuration

@AnthonyRuelle

This comment was marked as off-topic.

@rnenjoy

This comment was marked as off-topic.

@anthony-bernardo
Copy link

I don't understand well

Is the @darthf1 code workings or it's your current not working code ?

@shvchuk
Copy link

shvchuk commented Aug 11, 2023

@anthony-bernardo
I my case @darthf1 code with some project specific changes is working well.

Unfortunately sourcemaps do not work, but thats maybe my buggy code or some other issue I can't solve.

@nandi95
Copy link

nandi95 commented Aug 17, 2023

Bugsnag has a module for nuxt. That could be used as a starting point for sentry perhaps?
https://github.com/JulianMar/nuxt-bugsnag/blob/main/src/module.ts

@perzeuss
Copy link

perzeuss commented Aug 17, 2023

Maybe a maintainer could establish a branch specifically for v3 support and a feature branch where we start working on first features for nuxt3 support. Even when not all features of the current module are covered, one could do a pre-release, so we all can start using it. After that, we can improve the solution.

At the moment, everyone would have to copy over a workaround and maybe some of them improve the current workaround but do not come back and contribute an improvement.

@rchl
Copy link
Member Author

rchl commented Aug 17, 2023

Created nuxt3 from main.

@darthf1
Copy link

darthf1 commented Sep 19, 2023

@anthony-bernardo I my case @darthf1 code with some project specific changes is working well.

Unfortunately sourcemaps do not work, but thats maybe my buggy code or some other issue I can't solve.

Add

    sentryVitePlugin({
          ...

          sourcemaps: {
            assets: ['./.nuxt/dist/client/**'],
          },
    })

Snippet updated.

@nguyenhduc
Copy link

@anthony-bernardo I my case @darthf1 code with some project specific changes is working well.
Unfortunately sourcemaps do not work, but thats maybe my buggy code or some other issue I can't solve.

Add

    sentryVitePlugin({
          ...

          sourcemaps: {
            assets: ['./.nuxt/dist/client/**'],
          },
    })

Snippet updated.

and clean the sourcemaps after upload with

sentryVitePlugin({
      ...
      sourcemaps: {
        assets: ['./.nuxt/dist/client/**'],
        filesToDeleteAfterUpload: ['.nuxt/dist/**/*.js.map']
      },
})

@nikolasdas
Copy link

Have not tried it, but I found this repo. Looks promising, maybe it's a good start for a v3 version of this module?

@rchl
Copy link
Member Author

rchl commented Sep 19, 2023

Just a note that none of those solutions seem to handle server-side error tracking (on the h3 side).

@kogratte
Copy link

@rchl I was looking for a solution for server side. Your note is just in time!

@pallimalilsuhail
Copy link

@rchl @kogratte I was looking for the same. As @rchl mentioned it is working only on the client side, any idea of to implement it on the server side?

@pallimalilsuhail
Copy link

The below is what I currently have. It uses @sentry/vite-plugin, which should tick the second box. The below is most definitely not on par wit the current Nuxt 2 module, and the code is absolutely not battle tested. But maybe it can be used as a starting point.

~/nuxt.config.ts:

import { sentryVitePlugin } from '@sentry/vite-plugin'
import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
  ssr: false, // I have SSR false

  runtimeConfig: {
    public: {
      ENV: process.env.NODE_ENV ?? 'production',
      SENTRY_ENABLED: process.env.NUXT_PUBLIC_SENTRY_ENABLED,
      SENTRY_DSN: process.env.NUXT_PUBLIC_SENTRY_DSN,
      SENTRY_ENVIRONMENT: process.env.NUXT_PUBLIC_.SENTRY_ENVIRONMENT,
      SENTRY_RELEASE: process.env.NUXT_PUBLIC_SENTRY_RELEASE,
      SENTRY_TRACE_PROPAGATION_TARGET: process.env.NUXT_PUBLIC_SENTRY_TRACE_PROPAGATION_TARGET,
    },
  },

  sourcemap: {
    server: true,
    client: true,
  },

  vite: {
    build: {
      sourcemap: true,
    },
    plugins: [
      sentryVitePlugin({
          authToken: process.env.NUXT_PUBLIC_SENTRY_AUTH_TOKEN,
          debug: true,
          org: process.env.NUXT_PUBLIC_SENTRY_ORG,
          project: process.env.NUXT_PUBLIC_SENTRY_PROJECT,
          release: {
            name: process.env.NUXT_PUBLIC_SENTRY_RELEASE,
          },
          sourcemaps: {
            assets: ['./.nuxt/dist/client/**'],
          },
          telemetry: false,
        }),
    ],
  },
})

~/plugins/sentry.client.ts:

import {
  HttpClient as HttpClientIntegration,
  ReportingObserver as ReportingObserverIntegration,
} from '@sentry/integrations'
import type { Breadcrumb, CaptureContext, Primitive, User } from '@sentry/types'
import * as Sentry from '@sentry/vue'
import { withScope } from '@sentry/vue'
import type { Router } from 'vue-router'
import { defineNuxtPlugin } from '#app'

export default defineNuxtPlugin({
  parallel: true,
  setup: (nuxtApp) => {
    if (
      typeof window === 'undefined' ||
      !['true', true].includes(nuxtApp.$config.public.SENTRY_ENABLED)
    ) {
      return {
        provide: {
          sentrySetContext: (
            _name: string,
            _context: {
              [key: string]: any
            } | null,
          ) => {},
          sentrySetUser: (_user: User | null) => {},
          sentrySetTag: (_key: string, _value: Primitive) => {},
          sentryAddBreadcrumb: (_breadcrumb: Breadcrumb) => {},
          sentryCaptureException: (_exception: any, _captureContext?: CaptureContext) => {},
        },
      }
    }

    Sentry.init({
      app: nuxtApp.vueApp,
      autoSessionTracking: true,
      dsn: nuxtApp.$config.public.SENTRY_DSN,
      release: nuxtApp.$config.public.SENTRY_RELEASE,
      environment: nuxtApp.$config.public.SENTRY_ENVIRONMENT,
      integrations: [
        new Sentry.BrowserTracing({
          routingInstrumentation: Sentry.vueRouterInstrumentation(nuxtApp.$router as Router, {
            routeLabel: 'path',
          }),
        }),
        new Sentry.Replay({
          networkDetailAllowUrls: [`https//${nuxtApp.$config.public.HOST_NAME}`],
        }),
        new HttpClientIntegration(),
        new ReportingObserverIntegration(),
      ],
      tracePropagationTargets: [nuxtApp.$config.public.SENTRY_TRACE_PROPAGATION_TARGET],
      trackComponents: true,
      hooks: ['activate', 'create', 'destroy', 'mount', 'update'],
      // Set tracesSampleRate to 1.0 to capture 100%
      // of transactions for performance monitoring.
      // We recommend adjusting this value in production
      tracesSampleRate: 0.2,

      // Capture Replay for 10% of all sessions,
      // plus for 100% of sessions with an error
      replaysSessionSampleRate: 0.1,
      replaysOnErrorSampleRate: 1,
    })

    nuxtApp.vueApp.config.errorHandler = (err, context) => {
      withScope((scope) => {
        scope.setExtra('context', context)
        Sentry.captureException(err)
      })
    }

    nuxtApp.hook('app:error', (err) => {
      Sentry.captureException(err)
    })

    return {
      provide: {
        sentrySetContext: Sentry.setContext,
        sentrySetUser: Sentry.setUser,
        sentrySetTag: Sentry.setTag,
        sentryAddBreadcrumb: Sentry.addBreadcrumb,
        sentryCaptureException: Sentry.captureException,
      },
    }
  },
})

@darthf1 Have you tried anything for the server side?

@darthf1
Copy link

darthf1 commented Sep 20, 2023

No. Like I mentioned, I'm using ssr: false so no server side for me.

@tcarterBAMF
Copy link

@rchl @pallimalilsuhail @kogratte

I've been using the approaches offered upthread for getting Sentry integrated into Nuxt on the vite & vue side. (thanks for that!)

My first pass at making Sentry available to Nuxt on the server is with a Nitro plugin:

~/src/server/plugins/sentry.js:

import * as Sentry from "@sentry/node";

export default defineNitroPlugin((nitroApp) => {
  const config = useRuntimeConfig();
  Sentry.init({
    dsn: config.public.SENTRY_DSN,
    environment: config.public.SENTRY_ENVIRONMENT,
    debug: true,
    // ... Any other Sentry SDK options here
  });

  nitroApp.$sentry = Sentry;
  nitroApp.hooks.hook('error', async (error, { event }) => {
    Sentry.captureException(error);
  });

  nitroApp.hooks.hook('request', async (event) => {
    event.context.$sentry = Sentry;
  });
});

This uses Nitro's error hook to forward unhandled errors (or errors created with Nitro's createError()) to Sentry. This also captures unhandled errors in Vue component code running on the server.

Sentry is attached to the event context as $sentry at the beginning of a request in case a server page or middleware need access.

I guess some of the other Nitro hooks could be used to create Sentry breadcrumbs.

It doesn't know about the sourcemaps from Vite and I'm not sure how to tell it about them. It seems like Nuxt/Nitro uses its own build process and would need to coordinate with Vite about uploading them. Currently in a production Nuxt build, Vite has uploaded the source maps before Nitro starts compiling.

Hopefully this gives folks some ideas for improvements.

@rchl
Copy link
Member Author

rchl commented Sep 27, 2023

A bit simplistic since we should use Sentry's Request and Error handlers instead but maybe it will help someone with starting an implementation.

(Also when using tracing there should be Sentry's Tracing handler set up)

@nandi95
Copy link

nandi95 commented Sep 30, 2023

Mannil had a similar implementation on his blog: https://www.lichter.io/articles/nuxt3-sentry-recipe/#own-your-implementation Although, I think the type declaration should be this instead:

import type * as Sentry  from '@sentry/node';

declare module 'h3' {
    interface H3EventContext {
        $sentry?: typeof Sentry;
    }
}

@rudolfbyker
Copy link

rudolfbyker commented Oct 6, 2023

I have been experimenting with server-side Nuxt & Sentry integration, and the blog at https://www.lichter.io/articles/nuxt3-sentry-recipe/ has been very useful.

However, there is one thing missing: Distributed HTTP tracing.

Adding new Integrations.Http({ tracing: true }) to integrations when calling init is not enough. One needs to start and finish a transaction for each request. The central problem is: Sentry uses global state, while Nitro serves requests concurrently. So if you start the transaction during the request hook, and finish it during the afterResponse hook, it will only work if the response is sent before the next request comes in. Otherwise the new request will create a new transaction, which discards the previous transaction. On a high traffic site, this will effectively prevent any transaction from ever reaching Sentry.

Here is my example repo: https://github.com/rudolfbyker/sentry-nuxt3-server-side-example/tree/e2558941a1f211344578adc21404978fd21ca25c

I'm talking to Sentry support about this, but if any of you have an interim solution for the concurrency problem, please share it!

EDIT: Of course I has to ask an AI, and it said to use a Hub: https://www.phind.com/search?cache=c9d7p9dp9osuiyzh7ggrd2qj I would love to hear your feedback on whether this will actually solve our problem...

EDIT: Reverse engineering and/or re-using the following seems to be the way to go:

@rchl
Copy link
Member Author

rchl commented Oct 6, 2023

I suppose express also handles requests concurrently so it's nothing inherently different in how h3 does it. It's just that the implementation of the Sentry request handler needs to more closely mimic what Sentry is doing in its bundled express middleware.

@rudolfbyker
Copy link

rudolfbyker commented Oct 6, 2023

This version https://github.com/rudolfbyker/sentry-nuxt3-server-side-example/tree/f9da82eeaa51cdb94e41f6bc471bef0159ee0322 is my first attempt at re-using Sentry's express middleware in a Nitro server plugin. When looking at the console, it seems to work, but I don't see any data showing up in Sentry yet. I'm still debugging that...

EDIT: I can see some of the http.client spans in Sentry, but not all of them. I'm not sure if it's just hiding the short ones.

EDIT: It seems that I just had to be patient. It totally works. The "Slow HTTP Ops" on the "backend" tab of the "Performance" page is also working now.

@snakysnake
Copy link

snakysnake commented Nov 6, 2023

Hey quick question I see the nuxt3 branch, is it possible to install it already as a nuxt package? Something like npm i @nuxtjs/sentry@nuxt3?
Dear regards, snakysnake

@rchl
Copy link
Member Author

rchl commented Nov 6, 2023

No, the branch is just a fork and contains no Nuxt3-specific code..

@YoimarMoreno
Copy link

Anyone know an alternative to Sentry? open-source, of course. I looked for some by my own, but none of them are compatible with Nuxt 3. any advice? Thanks.

@daniluk4000
Copy link

Anyone know an alternative to Sentry? open-source, of course. I looked for some by my own, but none of them are compatible with Nuxt 3. any advice? Thanks.

https://www.lichter.io/articles/nuxt3-sentry-recipe/

We've made our setup using this guide and it works absolutely fine.

@YoimarMoreno
Copy link

Anyone know an alternative to Sentry? open-source, of course. I looked for some by my own, but none of them are compatible with Nuxt 3. any advice? Thanks.

https://www.lichter.io/articles/nuxt3-sentry-recipe/

We've made our setup using this guide and it works absolutely fine.

yeah... but sorry. Could you please show me an example of how to implement this on client side? Thanks.

@manniL
Copy link
Member

manniL commented Dec 15, 2023

@YoimarMoreno This is also included in the blog post 😋

@shvchuk
Copy link

shvchuk commented Dec 15, 2023

@manniL Have you already started working on sentry module for nuxt3? Is there a repo we could take a look and maybe contribute?

@YoimarMoreno
Copy link

@YoimarMoreno This is also included in the blog post 😋

Thanks. It works correctly.

@ssglopes
Copy link

ssglopes commented Dec 22, 2023

@manniL Thanks for your article which i followed. It works but i do get plenty of the below console errors:
The 'compilerOptions' config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, 'compilerOptions' must be passed to '@vue/compiler-dom' in the build setup instead.
Any idea how to fix this so these errors go away?

@LucaMargadant
Copy link

@ssglopes If you can live without the sentry replays, on my side removing new Sentry.Replay(), resolves the warnings.

@JhumanJ
Copy link

JhumanJ commented Jan 18, 2024

I followed this guide and everything worked: https://gearboxgo.com/articles/web-application-development/setting-up-sentry-with-nuxt-3

@AlejandroAkbal
Copy link

AlejandroAkbal commented Jan 22, 2024

Anyone know an alternative to Sentry? open-source, of course. I looked for some by my own, but none of them are compatible with Nuxt 3. any advice? Thanks.

GlitchTip is a Sentry-compatible open source alternative!
So it should work with the tutorials that people are posting here
https://glitchtip.com/

@bufke
Copy link

bufke commented Jan 25, 2024

If anyone has the time, you could contribute GlitchTip nuxt documentation by adding a markdown file here.

@Nomango
Copy link

Nomango commented Jan 26, 2024

@manniL Thanks for your article which i followed. It works but i do get plenty of the below console errors: The 'compilerOptions' config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, 'compilerOptions' must be passed to '@vue/compiler-dom' in the build setup instead. Any idea how to fix this so these errors go away?

I moved the lazy loading code of Sentry Replay into a component to solve this problem.

<!-- src/components/Sentry.vue -->
<script setup lang="ts">
onMounted(async () => {
  try {
    // lazy load sentry replay
    const { addIntegration, Replay } = await import("@sentry/vue");
    addIntegration(new Replay({}));
  } catch {}
});
</script>

<template></template>
<!-- app.vue -->
<template>
  <ClientOnly>
    <Sentry />
  </ClientOnly>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>

And here is my version to integrate Sentry by encapsulating it into a module. It works fine.

@sinneren
Copy link

How to use
import { captureMessage, setExtra, setTag } from '@sentry/vue';
in project. I have 500 err, it can't be imported.

@AndreyYolkin
Copy link

@manniL Thanks for your article which i followed. It works but i do get plenty of the below console errors: The 'compilerOptions' config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, 'compilerOptions' must be passed to '@vue/compiler-dom' in the build setup instead. Any idea how to fix this so these errors go away?

I moved the lazy loading code of Sentry Replay into a component to solve this problem.

<!-- src/components/Sentry.vue -->
<script setup lang="ts">
onMounted(async () => {
  try {
    // lazy load sentry replay
    const { addIntegration, Replay } = await import("@sentry/vue");
    addIntegration(new Replay({}));
  } catch {}
});
</script>

Nice idea! You can also use hook inside your plugin in order to keep components structure clean

  nuxtApp.hook('app:mounted', async () => {
    try {
      const { addIntegration, Replay } = await import('@sentry/vue')
      const replay = new Replay({
        beforeErrorSampling: event => {
          if (event.tags?.['no-sentry-replay']) {
            return false
          }
          return true
        },
      })
      addIntegration(replay)
    } catch {
      console.warn('Sentry replay not loaded')
    }
  })

@blombard
Copy link

getsentry/sentry-javascript#6929 (comment)

Sentry is actually taking a look at building a 1st class Nuxt SDK, @sentry/nuxt right now! 🚀

@Jesus82
Copy link

Jesus82 commented Jun 21, 2024

@manniL Thanks for your article which i followed. It works but i do get plenty of the below console errors: The 'compilerOptions' config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, 'compilerOptions' must be passed to '@vue/compiler-dom' in the build setup instead. Any idea how to fix this so these errors go away?

@ssglopes to get rid of those messages, you can wrap the content of your plugin with an if (config.public.NODE_ENV !== development)

@blombard
Copy link

getsentry/sentry-javascript#6929 (comment)

Sentry is actually taking a look at building a 1st class Nuxt SDK, @sentry/nuxt right now! 🚀

Package has been released: https://www.npmjs.com/package/@sentry/nuxt 🙌

@luc122c
Copy link

luc122c commented Aug 12, 2024

Package has been released: npmjs.com/package/@sentry/nuxt 🙌

It's worth noting that it is described by Sentry staff as being in the late alpha stage.

@rchl
Copy link
Member Author

rchl commented Aug 27, 2024

Closing as the Nuxt 3 Sentry module exists now.

@rchl rchl closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests