vue-migration-helper icon indicating copy to clipboard operation
vue-migration-helper copied to clipboard

Add detection of router.beforeEach() without calls to next()

Open Olivia5k opened this issue 8 years ago • 2 comments

I just spent an embarrassingly large amount of time trying to debug why nothing worked during my migration from 1.0.28. Turns out that the added requirement of the router.beforeEach() methods having to resolve the hook manually with a call to next() was the culprit.

As far as I can see, there is nothing in this project that alerts about this. Now, I lack the vue/js savvy to add that myself, but I suppose this could be of help to others who were using the beforeEach() hooks in 1.0.

Cheers for a fantastic tool anyway!

Olivia5k avatar Aug 03 '17 18:08 Olivia5k

Thanks for reporting this (and sorry to hear about the time you lost)! 😞 What would you think about the warning below?

1. Add next as the 3rd argument of the router.beforeEach hook, then call this function continue resolving the route
  Line 10: ./path/to/file.js
  Reason: The router.beforeEach hook has been updated to accept 3 arguments: to, from, and next
  More info: http://vuejs.org/guide/migration-vue-router.html#router-beforeEach

chrisvfritz avatar Aug 04 '17 19:08 chrisvfritz

Yes, that warning sounds great! It would definitely have saved me the time, haha!

(sorry for the late-ish reply - vacations happened)

Olivia5k avatar Aug 22 '17 09:08 Olivia5k