router-extras-module icon indicating copy to clipboard operation
router-extras-module copied to clipboard

windows environment Unable to update automatically router.js

Open 1415333545 opened this issue 3 years ago • 1 comments

@nuxt/router-extras/lib/extras.js

function invalidateRoute (file) {
  const routes = localRoutes.filter(route => route.component === file)
  console.log(localRoutes[0].component) // => print like "D:\\hyp-test\\nuxt-test\\pages\\Home.vue"
  console.log(file) // =>  print like "D:\hyp-test\nuxt-test\pages\Home.vue"
  /* istanbul ignore next */
  if (!routes.length) {
    return false
  }

  const extras = extractExtrasFromRoute(routes[0], false)

  return extras._needUpdate
}

// Should need
const routes = localRoutes.filter(route => normalize(route.component) === normalize(file))

1415333545 avatar Sep 02 '21 09:09 1415333545

I encountered the same bug on Windows. I tested your solution and it works. Consider creating a pull request? @1415333545

trumpdo197 avatar Sep 09 '21 11:09 trumpdo197