aurelia / router

A powerful client-side router.
MIT License
121 stars 115 forks source link

Navigation stops work after chunk load failure #598

Open iiiyx opened 6 years ago

iiiyx commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Precondition and steps to reproduce:

  1. Use code splitting: PLATFORM.moduleName(moduleId1, chunkName1), PLATFORM.moduleName(moduleId2, chunkName2), PLATFORM.moduleName(moduleId3, chunkName3)
  2. Configure router to use separate routes to modules (chunks)
  3. Block chunk2 from loading at Chrome dev-tools
  4. Navigate to blocked chunk2 route using a.href or Router.navigate
  5. Navigate to good chunk3 route using a.href or Router.navigate

Current behavior: Any navigation is not working at all after step 3.

Expected/desired behavior: Navigation to good chunks' routes should work

Stack trace for step 3:


__webpack_require__.oe | @ | bootstrap:167
-- | -- | --
  | Promise.catch (async) |   |  
  | push.async!system/system-index.module.exports | @ | system-index.js:4
  | (anonymous) | @ | aurelia-loader-webpack.js:185
  | step | @ | aurelia-loader-webpack.js:36
  | (anonymous) | @ | aurelia-loader-webpack.js:17
  | (anonymous) | @ | aurelia-loader-webpack.js:11
  | ./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.__awaiter | @ | aurelia-loader-webpack.js:7
  | ./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.WebpackLoader._import | @ | aurelia-loader-webpack.js:152
  | (anonymous) | @ | aurelia-loader-webpack.js:252
  | step | @ | aurelia-loader-webpack.js:36
  | (anonymous) | @ | aurelia-loader-webpack.js:17
  | (anonymous) | @ | aurelia-loader-webpack.js:11
  | ./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.__awaiter | @ | aurelia-loader-webpack.js:7
  | ./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.WebpackLoader.loadModule | @ | aurelia-loader-webpack.js:239
  | importViewModelResource | @ | aurelia-templating.js:3239
  | ensureViewModel | @ | aurelia-templating.js:4558
  | loadRoute | @ | route-loader.js:65
  | loadComponent | @ | aurelia-router.js:1515
  | loadRoute | @ | aurelia-router.js:1488
  | (anonymous) | @ | aurelia-router.js:1452
  | loadNewRoute | @ | aurelia-router.js:1451
  | run | @ | aurelia-router.js:1443
  | next | @ | aurelia-router.js:112
  | iterate | @ | aurelia-router.js:1221
  | processDeactivatable | @ | aurelia-router.js:1224
  | run | @ | aurelia-router.js:1155
  | next | @ | aurelia-router.js:112
  | (anonymous) | @ | aurelia-router.js:584
  | Promise.then (async) |   |  
  | run | @ | aurelia-router.js:582
  | next | @ | aurelia-router.js:112
  | run | @ | aurelia-router.js:125
  | (anonymous) | @ | aurelia-router.js:1773
  | Promise.then (async) |   |  
  | _dequeueInstruction | @ | aurelia-router.js:1727
  | (anonymous) | @ | aurelia-router.js:1718
  | _queueInstruction | @ | aurelia-router.js:1715
  | (anonymous) | @ | aurelia-router.js:1661
  | Promise.then (async) |   |  
  | loadUrl | @ | aurelia-router.js:1660
  | _loadUrl | @ | aurelia-history-browser.js:290
  | navigate | @ | aurelia-history-browser.js:230
  | navigate | @ | aurelia-router.js:822
  | onNavClick | @ | core-main.js:254
  | evaluate | @ | aurelia-binding.js:1524
  | callSource | @ | aurelia-binding.js:5171
  | handleEvent | @ | aurelia-binding.js:5180
  | handleDelegatedEvent | @ | aurelia-binding.js:3253
  onNavClick(route) {
    try {
      this.Router.navigate(route.relativeHref);
    } catch(e) {
      log.error(e);
    }
  }
iiiyx commented 6 years ago

this.Router.isNavigating gets stuck in the true value Neither router:navigation:complete nor router:navigation:error events arised.

Ischca commented 3 years ago

Is there an update on this? I have the same problem for v1.7.1.

bigopon commented 3 years ago

We are focusing our effort on v2, also this issue is a bit difficult to work on at the moment, as v1 router may need some more tests to cover the regression that may be introduced if we are to add a module loading failure recovery code.