Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error right after installing. "Rule can only have one resource source” #1905

Open
neznayer opened this issue Feb 15, 2023 · 1 comment
Open

Comments

@neznayer
Copy link

neznayer commented Feb 15, 2023

Environment


  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 2.16.1
  • Nitro Version: -
  • Package Manager: npm@7.17.0
  • Builder: webpack
  • User Config: head, css, plugins, components, buildModules, modules, build
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-tr1rgz?file=package.json

  • use Nuxt2 template in Stackblitz
  • npm i @nuxt/content^1
  • npm run dev

Describe the bug

Installing the @nuxt/content^1 package breaks something, and npm run dev gives error:

ERROR  Rule can only have one resource source (provided resource and test + include + exclude) in {                        18:56:42
  "type": "javascript/auto",
  "use": [
    {
      "loader": "/home/projects/nuxt-starter-tr1rgz/node_modules/babel-loader/lib/index.js",
      "options": {
        "configFile": false,
        "babelrc": false,
        "cacheDirectory": true,
        "envName": "client",
        "presets": [
          [
            "/home/projects/nuxt-starter-tr1rgz/node_modules/@nuxt/babel-preset-app/src/index.js",
            {
              "corejs": {
                "version": 3
              }
            }
          ]
        ]
      },
      "ident": "clonedRuleSet-4.use[0]"
    }
  ]
}

  "type": "javascript/auto",
  "use": [
  {
  "loader": "node_modules/babel-loader/lib/index.js",
  "options": {
  "configFile": false,
  "babelrc": false,
  "cacheDirectory": true,
  "envName": "client",
  "presets": [
  [
  "node_modules/@nuxt/babel-preset-app/src/index.js",
  {
  "corejs": {
  "version": 3
  }
  }
  ]
  ]
  },
  "ident": "clonedRuleSet-4.use[0]"
  }
  ]
  }
  at checkResourceSource (node_modules/@nuxt/webpack/node_modules/webpack/lib/RuleSet.js:167:11)
  at RuleSet.normalizeRule (node_modules/@nuxt/webpack/node_modules/webpack/lib/RuleSet.js:198:4)
  at eval (node_modules/@nuxt/webpack/node_modules/webpack/lib/RuleSet.js:110:20)
  at Array.map (<anonymous>)
  at RuleSet.normalizeRules (node_modules/@nuxt/webpack/node_modules/webpack/lib/RuleSet.js:109:17)
  at new RuleSet (node_modules/@nuxt/webpack/node_modules/webpack/lib/RuleSet.js:104:24)
  at new NormalModuleFactory (node_modules/@nuxt/webpack/node_modules/webpack/lib/NormalModuleFactory.js:115:18)
  at Compiler.createNormalModuleFactory (node_modules/@nuxt/webpack/node_modules/webpack/lib/Compiler.js:636:31)
  at Compiler.newCompilationParams (node_modules/@nuxt/webpack/node_modules/webpack/lib/Compiler.js:653:30)
  at Compiler.compile (node_modules/@nuxt/webpack/node_modules/webpack/lib/Compiler.js:661:23)

Additional context

I was trying to file another issue to here, by trying to replicate the conditions on stackBlitz, when it happened

Logs

No response

@neznayer neznayer changed the title Rule can only have one resource source Error right after installing. "Rule can only have one resource source” Feb 15, 2023
Copy link
Member

I think this is related to webpack javascript/auto rule in nuxt@v2.16.0.

Maybe @danielroe could give us some hint about it or possible solution.

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

No branches or pull requests

2 participants