Skip to content

Upgrade webpack from 1.x to latest 2.2 then router history manipulation broken when using code splitting #1115

Closed
@huangyingjie

Description

@huangyingjie
  • This happens only if I use code splitting.
    All components can work correctly at the first loading, then if you go back to the visited component, it disappears, the content are blank.
    beforeCreatedcreated... the component's lifecycle does not execute as expected.
    But when use webpack 1.x, this is all right.
    Or if I do not use code splitting, it can work correctly too.

Vue.js / vue-router versions

Vue.js: 2.1.10
Vue-router: 2.1.3
Webpack: 2.2.0

Reproduction Link

Upgrade Webpack to 2.2
https://github.com/huangyingjie/vue-router-webpack2-bug-demo

Steps to reproduce

npm start and click the link.

What is Expected?

router.go can works correctly.

What is actually happening?

component does not load then content is blank.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions