Skip to content
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

Vue-router error #2

Closed
Vertygo opened this issue Mar 1, 2017 · 5 comments
Closed

Vue-router error #2

Vertygo opened this issue Mar 1, 2017 · 5 comments

Comments

@Vertygo
Copy link

Vertygo commented Mar 1, 2017

Hi Justin,

I was following your blog post about writing aspnet core app with Vue and I wanted to do it using VS 2017 + latest packages available for vue2 + webpack2 and it seems that I got everything right except that after running solution I got this error in browser:

Uncaught TypeError: Router is not a constructor
    at eval (eval at <anonymous> (app.js:1654), <anonymous>:7:19)
    at Object.<anonymous> (app.js:1654)
    at __webpack_require__ (app.js:1299)
    at fn (app.js:720)
    at eval (eval at <anonymous> (app.js:1502), <anonymous>:7:16)
    at Object.<anonymous> (app.js:1502)
    at __webpack_require__ (app.js:1299)
    at fn (app.js:720)
    at Object.<anonymous> (app.js:1807)
    at __webpack_require__ (app.js:1299)

It could be that this is connected to this issue but since this is all new to me I`m not sure
I have uploaded example into repo

@Vertygo
Copy link
Author

Vertygo commented Mar 1, 2017

As described in this issue we should add vue-router alias in webpack.

@Vertygo Vertygo closed this as completed Mar 1, 2017
@justinyoo
Copy link
Contributor

@Vertygo Thanks for raising this issue. Yes, it occurs after the breaking change of vue.js 2.2.0. I will update this repo soon.

@justinyoo
Copy link
Contributor

justinyoo commented Mar 2, 2017

@Vertygo Just FYI,

Seems that the router issue has been fixed on vue@2.2.1. I'm testing it against vue@2.2.1, typescript@2.2.1 and vue-router@2.2.0. We don't need to add an alias for the router any more.

I followed the new recommendation described in the official guide.

@Vertygo
Copy link
Author

Vertygo commented Mar 2, 2017

That is odd because I`m using vue 2.2.1 and vue-router 2.3.0. Maybe its issue with vue-router 2.3.0?

@justinyoo
Copy link
Contributor

justinyoo commented Mar 2, 2017

@Vertygo Not quite sure. I always use vue-cli to install the basic template as a starting point. All sample codes in this repo are using the basic template which uses vue-router@2.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants