-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Bug: global property augmentation of $gtm
breaks type checks
#464
Comments
Thanks for the notification about that. |
Okay 🤔 I'm a bit confused, because the interface is still there, and even has in its JSDoc the used way described. Maybe this is really new and I would like to make the change when their decision is "stable". |
Honestly I was myself puzzled when I saw this change landing in For example, Also |
@romansp Just as a temporary workaround, you can use https://github.com/gtm-support/vue-gtm#using-with-composition-api |
@romansp any news? did you e.g. open an issue in vue related to that which you could link here? |
@Shinigami92 no certain news right now and still trying to confirm. Important This release replaces I absolutely understand you being extra cautious not to break other people's code but I'm afraid this change will have to be made. |
So... I had an internal discussion with some Vue ecosystem persons, and the "issue" is originally coming from vue-tsc and not vue itself Do you want to open up a PR (so you will also be visible in release notes and commit history) and implement the requested change? you should update the vue peer dependency to ">= 3.2.26 < 4.0.0" Line 92 in 5268e63
|
Sounds good, I got message back from posva on vue-router Discord confirming the change as well https://discord.com/channels/325477692906536972/325479452773580800/1272810301661777981.
Will open PR later today. |
…nting 'vue' module, fixes gtm-support#464
Also started an issue in Vue to fix JSDoc vuejs/core#11605. |
Info
vue-gtm
uses this way to augment global properties.vue-gtm/src/index.ts
Lines 202 to 211 in 5268e63
This differs from the recommended one in Vue 3. Instead
vue
module should be augmented.For example
vue-router
changed their global augmentation in version 4.4.1 from@vue/runtime-core
to recommendedvue
. Caveat is that augmentation should be consistent through the whole codebase otherwise TypeScript fails to resolve types properly.Recommended action is to update module augmentation in all referenced packages. vuejs/router#2321 (reply in thread)
This seems to be an ongoing issue in Vue ecosystem as now all packages will need to fix their augmentation to use
vue
instead of@vue/runtime-core
. For exampleunimport
did it here unjs/unimport#359The text was updated successfully, but these errors were encountered: