vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

"Rule can only have one resource source" failure occurs when running server or building for production #5986

Open vpasquier opened 3 years ago

vpasquier commented 3 years ago

Version

4.5.8

Environment info

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
  Binaries:
    Node: 14.14.0 - ~/.nvm/versions/node/v14.14.0/bin/node
    Yarn: Not Found
    npm: 6.14.8 - ~/.nvm/versions/node/v14.14.0/bin/npm
  Browsers:
    Chrome: 86.0.4240.80
    Edge: Not Found
    Firefox: 79.0
    Safari: 14.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.0-rc.2
    @vue/babel-plugin-jsx:  1.0.0-rc.3
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.8
    @vue/babel-preset-jsx:  1.2.3
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.1
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli: ^4.5.8 => 4.5.8
    @vue/cli-overlay:  4.5.8
    @vue/cli-plugin-babel: ^4.5.8 => 4.5.8
    @vue/cli-plugin-eslint: ^4.5.8 => 4.5.8
    @vue/cli-plugin-router:  4.5.8
    @vue/cli-plugin-vuex:  4.5.8
    @vue/cli-service: ^4.5.8 => 4.5.8
    @vue/cli-shared-utils:  4.5.8
    @vue/cli-ui:  4.5.8
    @vue/cli-ui-addon-webpack:  4.5.8
    @vue/cli-ui-addon-widgets:  4.5.8
    @vue/compiler-core:  3.0.1
    @vue/compiler-dom:  3.0.1
    @vue/compiler-sfc:  3.0.1
    @vue/compiler-ssr:  3.0.1
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.0.1
    @vue/runtime-core:  3.0.1
    @vue/runtime-dom:  3.0.1
    @vue/shared:  3.0.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^7.1.0 => 7.1.0
    typescript:  3.9.7
    vue: ^2.6.10 => 2.6.12 (3.0.1)
    vue-cli-plugin-apollo:  0.21.3
    vue-codemod:  0.0.4
    vue-eslint-parser:  7.1.1
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.3 (16.0.0-beta.8)
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.12
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

What is expected?

To be built correctly

What is actually happening?

Error occurs:

Error: Rule can only have one resource source (provided resource and test   include   exclude) in {
  "exclude": [
    null
  ],
  "use": [
    {
      "loader": "./node_modules/cache-loader/dist/cjs.js",
      "options": {
        "cacheDirectory": "./node_modules/.cache/babel-loader",
        "cacheIdentifier": "d7e2daba"
      },
      "ident": "clonedRuleSet-38[0].rules[0].use[0]"
    },
    {
      "loader": "/Users/vp/nuxeo/nuxeo-insight-ui/node_modules/babel-loader/lib/index.js",
      "options": "undefined",
      "ident": "undefined"
    }
  ]
}
iamludal commented 2 years ago

The problem still exists, and that's really infuriating. The solution is NOT to downgrade to a lower version of webpack or whatever package. One should be able to use it with node 16 (indeed, if you want to use this version, webpack 5 is required by some other packages).

nth-chile commented 1 year ago

My question is, why does my project's version of webpack affect vue's version of webpack?

shadow7412 commented 1 year ago

My question is, why does my project's version of webpack affect vue's version of webpack?

Cause you're building it?

nth-chile commented 1 year ago

@shadow7412 it shouldn't matter which version I'm using. Vue should use whichever version it wants