Cannot start freshly generated vue app due to "Rule can only have one resource source" error
See original GitHub issueCurrent Behavior
A cryptic error is thrown when trying to serve the app without modification from the generator.
nx run my-app:serve
Produces this output:
> NX Rule can only have one resource source (provided resource and test + include + exclude) in {
"exclude": [
null
],
"use": [
{
"loader": "/Users/...snipped.../vue-test/node_modules/cache-loader/dist/cjs.js",
"options": {
"cacheDirectory": "/Users/...snipped.../vue-test/node_modules/.cache/babel-loader",
"cacheIdentifier": "7e933023"
},
"ident": "clonedRuleSet-39.use[0]"
},
{
"loader": "/Users/...snipped.../vue-test/node_modules/babel-loader/lib/index.js",
"options": {
"configFile": "/Users/...snipped.../vue-test/apps/my-app/babel.config.js"
},
"ident": "clonedRuleSet-39.use[1]"
}
]
}
Expected Behavior
nx serve my-app
should serve the application
Steps to Reproduce
I ran the followed commands to create a totally blank nx workspace and create a blank vue app.
npx create-nx-workspace
β Workspace name (e.g., org name) Β· vue-test
β What to create in the new workspace Β· apps
β Set up distributed caching using Nx Cloud (It's free and doesn't require registration.) Β· No
npm install @nrwl/cypress @nrwl/jest @nrwl/linter --save-dev
npm install @nx-plus/vue --save-dev
nx g @nx-plus/vue:app
β What name would you like to use? Β· my-app
β Which style format would you like to use? Β· scss
β Would you like to configure routing for this application? (y/N) Β· false
β Which version of Vue.js would you like to use? Β· 2
β Use Babel alongside TypeScript? (y/N) Β· true
nx run my-app:serve
I put the result of that in this github repo: https://github.com/AlexJWayne/vue-test
I also tried other configurations of the genrator (vue3, not using babel, plain css) but got the same result.
Failure Logs
Full error with verbose logging:
β nx serve my-app --verbose
> nx run my-app:serve --verbose=true
INFO Starting development server...
> NX Rule can only have one resource source (provided resource and test + include + exclude) in {
"exclude": [
null
],
"use": [
{
"loader": "/Users/...snipped.../vue-test/node_modules/cache-loader/dist/cjs.js",
"options": {
"cacheDirectory": "/Users/...snipped.../vue-test/node_modules/.cache/babel-loader",
"cacheIdentifier": "7e933023"
},
"ident": "clonedRuleSet-39.use[0]"
},
{
"loader": "/Users/...snipped.../vue-test/node_modules/babel-loader/lib/index.js",
"options": {
"configFile": "/Users/...snipped.../vue-test/apps/my-app/babel.config.js"
},
"ident": "clonedRuleSet-39.use[1]"
}
]
}
Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
"exclude": [
null
],
"use": [
{
"loader": "/Users/...snipped.../vue-test/node_modules/cache-loader/dist/cjs.js",
"options": {
"cacheDirectory": "/Users/...snipped.../vue-test/node_modules/.cache/babel-loader",
"cacheIdentifier": "7e933023"
},
"ident": "clonedRuleSet-39.use[0]"
},
{
"loader": "/Users/...snipped.../vue-test/node_modules/babel-loader/lib/index.js",
"options": {
"configFile": "/Users/...snipped.../vue-test/apps/my-app/babel.config.js"
},
"ident": "clonedRuleSet-39.use[1]"
}
]
}
at checkResourceSource (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/RuleSet.js:167:11)
at Function.normalizeRule (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/RuleSet.js:198:4)
at /Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/RuleSet.js:110:20
at Array.map (<anonymous>)
at Function.normalizeRules (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/RuleSet.js:109:17)
at new RuleSet (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/RuleSet.js:104:24)
at new NormalModuleFactory (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:115:18)
at Compiler.createNormalModuleFactory (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:636:31)
at Compiler.newCompilationParams (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:653:30)
at Compiler.compile (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:661:23)
at /Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Watching.js:77:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:33:1)
at AsyncSeriesHook.lazyCompileHook (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/tapable/lib/Hook.js:154:20)
at Watching._go (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Watching.js:41:32)
at /Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Watching.js:33:9
at Compiler.readRecords (/Users/...snipped.../vue-test/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:529:11)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> NX Running target "my-app:serve" failed
Failed tasks:
- my-app:serve
Hint: run the command with --verbose for more details.
Environment
Plugin name and version: @nx-plus/vue@4.1.0
β nx report
> NX Report complete - copy this into the issue template
Node : 16.15.0
OS : darwin x64
npm : 8.5.5
nx : 14.4.2
@nrwl/angular : Not Found
@nrwl/cypress : 14.4.2
@nrwl/detox : Not Found
@nrwl/devkit : 14.4.2
@nrwl/eslint-plugin-nx : 14.4.2
@nrwl/express : Not Found
@nrwl/jest : 14.4.2
@nrwl/js : Not Found
@nrwl/linter : 14.4.2
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 14.4.2
typescript : 4.7.4
---------------------------------------
Community plugins:
@nx-plus/vue: 14.1.0
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Error: Rule can only have one resource source (provided ...
Had this error on the netlify build process running gridsome build. using node v12.18.0 (npm v6.14.4) downgraded webpack from v5 to v4 workedΒ ......
Read more >"Rule can only have one resource source" failure ... - GitHub
This error raises by combination of @vue/cli-plugin-babel and vue-loader 's plugin-webpack5.js . webpack 5 looks reject combining test / includeΒ ...
Read more >Help with "Error: Rule can only have one resource source"
i have some issues with my app. yesterday everything was ok. this morning βnpm run serveβ return me. Error: Rule can only have...
Read more >[Solved]-Error: Rule can only have one resource source ...
[Solved]-Error: Rule can only have one resource source (provided resource and test + include + exclude)-Vue.js ... For me I was using npm...
Read more >Vue.js | IntelliJ IDEA Documentation - JetBrains
With the built-in debugger, you can debug your Vue.js code right in IntelliJ IDEA, which can automatically generate the necessary run/debugΒ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have recently published @nx-plus/vue@15.0.0-rc.0 which now used vue-cli v5 (webpack 5). I havenβt published any docs/migrations yet but if youβre curious you can try it out! It requires v15 of Nx.
Iβm going to be working over the next week to write some docs and migrations so stay tuned!
@AlexJWayne are you still experiencing this issue? I wasnβt able to reproduce this and the reproduction you provided gives me a βPage Not Foundβ. Can you post another reproduction?
@mgray88 Vue 2.7 had some webpack changes, so maybe the npm i bumped it and it resolved itself.