Skip to content

Conversation

@stuartZhang
Copy link

bug fix: Each "*.vue" file is loaded twice in runtime. The root reason is that the same ".vue" file is referenced twice with different ref path.

  • The 1st ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue
  • The 2nd ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue

As you see, there are two ref paths for the identical "*.vue" file (e.g. ./src/components/VuxDemo.vue). What's worse, there are two fragments "!./node_modules/vux-loader/src/script-loader.js" in the first one, which is erroneous and brings about the module-cache failure.

My change fixes it.

…n is that the same ".vue" file is referenced twice with different ref path.

- The 1st ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue
- The 2nd ref path: ./node_modules/babel-loader/lib/index.js!./node_modules/vux-loader/src/script-loader.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/VuxDemo.vue

As you see, there are two ref paths for the identical "*.vue" file (e.g. ./src/components/VuxDemo.vue). What's worse, there are two fragments "!./node_modules/vux-loader/src/script-loader.js" in the first one, which is erroneous and brings about the module-cache failure.

My change fixes it.
@stuartZhang
Copy link
Author

The usage environment of my project:

  • Webpack 4
  • Babel 7
  • Vue 2.5.18

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant