Description
Version
3.0.0-beta.15
Reproduction link
https://github.com/doppelreim/vue-test-app/tree/test-import-route
Steps to reproduce
Run npm run serve
What is expected?
The app should compile without warnings.
What is actually happening?
It does not compile without warnings.
The output says:
WARNING Compiled with 4 warnings 12:38:25
warning in ./src/components/HelloWorld.vue?vue&type=script&lang=ts
"export 'Route' was not found in 'vue-router'
warning in ./src/components/HelloWorld.vue?vue&type=script&lang=ts
"export 'Route' was not found in 'vue-router'
warning in ./src/components/HelloWorld.vue?vue&type=script&lang=ts
"export 'Route' was not found in 'vue-router'
warning in ./src/components/HelloWorld.vue?vue&type=script&lang=ts
"export 'Route' was not found in 'vue-router'
The change that introduces the warnigns can be seen here:
doppelreim/vue-test-app@af03672
I want to add a Watcher on $route
. The parameters of the function (newRoute
and oldRoute
) should be typed. I assume Route
is the correct type.
I checked out /node_modules/vue-router/types/index.d.ts
and there Route
does get exported, as far as I can tell.
If I use Route
inside of the function-body, like this:
const r: Route = {
path: '',
hash: '',
query: {},
params: {},
fullPath: '',
matched: [],
};
then it does not throw errors.
And if i leave out some of the required attributes, then the compiler rightfully complains. So I assume the export/import does work here.