Skip to content

Sentry/vue is not reporting errors in production. Misconfigured SDK error #6629

@CalElAn

Description

@CalElAn

Environment

SaaS (https://sentry.io/)

Version

7.28.1

Link

No response

DSN

No response

Steps to Reproduce

  1. Create a laravel inertia application
  2. Install inertia scaffolding with vue
  3. Install Sentry.io following this official guide
  4. run npm build
  5. Create a button that throws a test error.
  6. The error is thrown and logged in console. However no error is reported to sentry.

When I run npm build, this is the error that shows up in the console:

[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured.
Update your Sentry.init call with an appropriate config option:
app (Application Instance - Vue 3) or Vue (Vue Constructor - Vue 2).

It works on local though, when I run "npm run dev". Errors are reported to sentry.

The code:

createInertiaApp({
  title: (title) => `${title} - ${appName}`,
  resolve: (name) => {
    const page = resolvePageComponent(
      `./Pages/${name}.vue`,
      import.meta.glob('./Pages/**/*.vue')
    );
    return page;
  },
  setup({ el, app, props, plugin }) {
    const vueApp = createApp({ render: () => h(app, props) }).use(plugin)
    .mixin({ methods: { route } });

    Sentry.init({
      vueApp,
      dsn: 'dsn',
      integrations: [
        new BrowserTracing({
          tracePropagationTargets: [
            'localhost',
            'my-url.org',
            /^\//,
          ],
        }),
      ],
      tracesSampleRate: 1,
      logErrors: true,
    });

    vueApp.mount(el);

    return vueApp;
  },
});

Expected Result

Seeing the error on Sentry.io after pressing the button.

Actual Result

This warning in the console:

[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured.
Update your Sentry.init call with an appropriate config option:
app (Application Instance - Vue 3) or Vue (Vue Constructor - Vue 2).

Errors do not get sent to sentry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: vueIssues related to the Sentry Vue SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions