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
Type Definitions broken in 2.3.0? #1202
Comments
/cc @ktsn |
For now I think you can work around this by configuring a webpack alias pointing |
@yyx990803 Yes, that workaround works. Thanks. |
This is because TypeScript treats Also we need to update core's typings. I'll create some PRs. |
Hmm, I found the above approach is problematic... If we declare I think the most compromisable solution is to remove @HerringtonDarkholme Do you have any better idea to deal with this problem? |
If that's the case, I'd prefer supporting |
Hi, @eugirdor . For now you can use I think Vue typing will have a fix release. |
See updated TS integration docs: https://vuejs.org/v2/guide/typescript.html |
Does this configuration support webpack2 tree-shaking? |
Vue.js / vue-router versions
2.1.2 / 2.3.0
Reproduction Link
Steps to reproduce
Using Typescript 2.2.1 and Webpack 2.2.1
In VueRouter 2.2.1 importing was done with
import VueRouter = require('vue-router')
but it looks like in 2.3.0 it needs to beimport VueRouter from 'vue-router'
.The issue is that it looks like the type definitions still define the export as
export = VueRouter
where it needs to beexport default VueRouter
now.What is Expected?
Importing 'vue-router' the proper way should not give a compiler warning.
What is actually happening?
When Using:
import VueRouter = require('vue-router')
You Get:
Uncaught TypeError: VueRouter is not a constructor
When Using:
import VueRouter from 'vue-router
You Get: Compiler warning that vue-router
has no default export
The text was updated successfully, but these errors were encountered: