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

[Regression] Using router methods without Vue instance causes error #922

Closed
blake-newman opened this issue Nov 21, 2016 · 3 comments
Closed

Comments

@blake-newman
Copy link
Member

blake-newman commented Nov 21, 2016

  TypeError: null is not an object (evaluating 'this$1.router.app.$nextTick')
  at webpack:///~/vue-router/dist/vue-router.js:1321:0 <- /Users/blake/work/vue-creating-scalable-apps-workshop/final/test/unit/index.js:8738

Source location

Git Bisect points at 83418bc

Using router methods without Vue instance causes the above error. This affects unit tests with PhantomJS due to a popstate event after tests are finished. This also breaks when using the feature as intended.

Note: The line that causes the error is to ensure that asynchronous components are resolved before callbacks are executed. We can not rely on the router.app as this may not be available.

@blake-newman blake-newman changed the title [Regression] [PhantomJS] Error occurs with unit tests [Regression] Using router methods without Vue instance causes error Nov 21, 2016
blake-newman added a commit to blake-newman/vue-router that referenced this issue Nov 22, 2016
- Add example for regression/e2e tests
- Added test and ensuring that later mounted instance with router takes affect
- Install monkey patches Vue.nextTick to VueRouter._nextTick
blake-newman added a commit to blake-newman/vue-router that referenced this issue Nov 22, 2016
- Add example for regression/e2e tests
- Added test and ensuring that later mounted instance with router takes affect
- Use _Vue.nextTick from install instead of router.app.$nextTick
@ealves-pt
Copy link

Same problem here, only working if I use v2.0.1.

@sam-b-rose
Copy link

I think this should be reopened. I am still getting the same error as @blake-newman when using v2.2.1. Like @ealves-pt I do not get the error if using v2.0.1

TypeError: undefined is not an object (evaluating '_Vue.extend')
at webpack:///~/vue-router/dist/vue-router.common.js:1737:0 <- index.js:36394

@posva
Copy link
Member

posva commented Feb 25, 2017

@samrose3 If that the case, can you open a new issue with a minimal repro, please?

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

No branches or pull requests

4 participants