Sentry-javascript: Use of non-public Vue.util breaks type-checking

Created on 3 Jun 2020  路  7Comments  路  Source: getsentry/sentry-javascript

Package + Version

  • [ ] @sentry/browser
  • [ ] @sentry/node
  • [ ] raven-js
  • [ ] raven-node _(raven for node)_
  • [x] other: @sentry/integrations

Version:

5.16.0

Description

The interface declaration in _vue.d.ts_ requires Vue.util, but this is not publicly exposed by Vue as declared in this comment - https://github.com/vuejs/vue/blob/fb589e6f9bc7db56a508f8f610ce321377bf0a6f/dist/vue.js#L5392, and also that Vue's types declarations do not contain util - https://github.com/vuejs/vue/blob/dev/types/vue.d.ts.

This is causing type-checking to return _Property 'util' is missing in type 'VueConstructor' but required in type 'VueInstance'_ and breaks the build.

Needs Triage

Most helpful comment

Thanks for letting us know! Fixed in https://github.com/getsentry/sentry-javascript/pull/2634
Also, changed config to be non-optional, as this is how it is in the original Vue types as well.
Cheers!

All 7 comments

This is something that also affects us at the moment. Workaround for now is to add a // @ts-ignore for the time being.

Thanks for letting us know! Fixed in https://github.com/getsentry/sentry-javascript/pull/2634
Also, changed config to be non-optional, as this is how it is in the original Vue types as well.
Cheers!

@kamilogorek when is this fix expected to be released ?

Just merged it. We should cut the next release on Monday afternoon :)

Fixed in 5.17.0. Cheers!

image
image

@xin- this is broken because vue-apollo-model is overriding original Vue types - https://github.com/skyline0705/vue-apollo-model/blob/739436a8b8410774236149db29deef1fa0bac623/src/types.ts#L62-L77
It should be fixed there, as Vue.utils is not the part of publicly exposed API see - https://github.com/vuejs/vue/blob/0baa129d4cad44cf1847b0eaf07e95d4c71ab494/src/core/global-api/index.js#L34-L42

Was this page helpful?
0 / 5 - 0 ratings