Search code examples
typescriptvue.jssentry

Build fails at the code for initialising Sentry's Vuejs (with Typescript) Integration


When I run the build for my (vue-cli-3 based) Vuejs project via gitlab-runner on my local, it breaks with the following error:

98% after emitting CopyPlugin ERROR  Failed to compile with 1 errors ...
Property 'util' is missing in type 'VueConstructor<Vue>' but required in type 'VueInstance'.

    75 |   integrations: [
    76 |     Integrations.Vue({
  > 77 |       Vue,
       |       ^
    78 |       attachProps: true,
    79 |     })

I have imported Vue, Sentry and Sentry Integrations at the top of the same file as follows:

import Vue from "vue";
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';

What does the error mean and how can i fix this ?


Solution

  • Ran into the same issue today after a yarn upgrade.

    After some searching this appears to be a bug in the integrations part of Sentry. You can find more information about this here: https://github.com/getsentry/sentry-javascript/issues/2633

    It also includes a workaround to get around this issue until a fix is released.