Error launching build with version v4.4.1 and v4.4.2 #2321
-
ReproductionLaunch the build Steps to reproduce the bugLaunch npm run build Expected behaviorBuild ends correctly Actual behaviorBuild show error for every usage of $route and $router in TypeScript Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments 14 replies
-
Here's an example:
|
Beta Was this translation helpful? Give feedback.
-
Same for our Nuxt project, but can't reproduce in plain empty project. Weird... |
Beta Was this translation helpful? Give feedback.
-
Same issue here - I'll try to work on a reproduction as this issue hasn't provided one, but I'm super busy today so I dunno when I'll be able to provide it! If anyone else can provide one first that would be great :) |
Beta Was this translation helpful? Give feedback.
-
Speculate that the error occurred between |
Beta Was this translation helpful? Give feedback.
-
This is also happening to me while using https://github.com/unplugin/unplugin-auto-import. After the upgrade, I see lots of errors. Looks like |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as disruptive content.
This comment was marked as disruptive content.
-
@posva I'm sorry for the previous, I didn't want to anger you. I've misunderstood moving the issue to a discussion as if it wasn't important and was delayable. I've not added more details because of lack of time and because I thought there wasn't much to say: I've made no changes from the previous version (v4.4.0) and after I upgraded (automatically, launching an npm i, because I had set version like this -> "^4.4.0" in the packages.json) to both the versions every $route or $router version usage in TS code was marked as error. I still think that, if this change was made to fix problems for other users and it's not an error, it shouldn't be made in a patch version simply because of the fact that is breaking, don't you think? In order to add some information to help you, I upgraded in multiple projects and this bug happens in all of them. |
Beta Was this translation helpful? Give feedback.
-
Are there any updates? It's hard to tell what is wrong. I would love to help otherwise. I find all my modules with typescript, specifically with |
Beta Was this translation helpful? Give feedback.
-
Problem has been solved for us with [email protected]. |
Beta Was this translation helpful? Give feedback.
-
I've had the same problem with this code since I upgraded to version 4.4.2 of vue-router. "export let $t: ComponentCustomProperties['$t'];" |
Beta Was this translation helpful? Give feedback.
-
Interesting... I use https://github.com/antfu-collective/vitesse/ as a template. And I noticed that project has also been updated to |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing the same issue. export default myPlugin;
declare module 'vue' {
interface ComponentCustomProperties {
$sanitize: typeof sanitize;
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$sanitize: typeof sanitize;
}
} This should follow the official doc instructions: https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties Only using the 2nd type fixes the error for me: export default myPlugin;
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$sanitize: typeof sanitize;
}
} |
Beta Was this translation helpful? Give feedback.
-
I'm confused why this is a discussion and not an issue. Literally all of my projects are broken because of this unless I revert back to vue-router version 4.4.0. I will try and make a test case. |
Beta Was this translation helpful? Give feedback.
-
I confirm that after a global upgrade of all my packages I have the same problem, I was not able to determine which upgrade started the issue, but I confirm that using version 4.4.0, solve the issue for now. I also briefly saw the same issue not only with $router, but also with all my $t (vue-i18n). |
Beta Was this translation helpful? Give feedback.
-
This is sort of in the changelog ("If you are also augmenting @vue/runtime-core, you will likely have to change it to vue.") but I didn't initially read that as "if you are transitively, via a dependency, augmenting...". It may be helpful to future troubleshooters to include a link to this discussion on the changelog for 4.4.1. |
Beta Was this translation helpful? Give feedback.
It seems that all
declare module "@vue/runtime-core"
in other packages need to be modified todeclare module "vue"