microsoft / lage

Task runner in JS monorepos
https://microsoft.github.io/lage
MIT License
735 stars 70 forks source link

v2: no targets found that matches the given scope. #577

Open niemyjski opened 1 year ago

niemyjski commented 1 year ago

Describe the bug

I upgraded https://github.com/exceptionless/Exceptionless.JavaScript from latest 1.9.x to 2.0.0 and now when I run

npm run build

> @exceptionless/monorepo@2.0.0-dev build
> lage build --no-cache --verbose --no-deps

lage: no targets found that matches the given scope.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/exceptionless/Exceptionless.JavaScript
  2. Upgrade lage to latest release and npm install
  3. run npm run build
  4. See error

Expected behavior It should build all the projects.

Environment/Troubleshooting

  System:
    OS: Windows 10 10.0.22621
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 17.10 GB / 31.92 GB
  Binaries:
    Node: 19.6.0 - C:\Program Files\nodejs\node.EXE
    npm: 7.22.0 - ~\AppData\Roaming\npm\npm.CMD
  Managers:
    pip3: 22.3 - C:\Python311\Scripts\pip3.EXE
  Utilities:
    Git: 2.39.1.
    FFmpeg: 5.1.2 - C:\ProgramData\chocolatey\bin\ffmpeg.EXE        
  Virtualization:
    Docker: 20.10.21 - C:\Program Files\Docker\Docker\resources\bin\docker.EXE
  IDEs:
    VSCode: 1.75.0 - C:\Users\blake\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
    Visual Studio: 17.5.33318.248 (Visual Studio Community 2022)    
  Languages:
    Java: javac 16
    Python: 3.11.0
  Databases:
    SQLite: 3.32.2 - C:\Android\android-sdk\platform-tools\sqlite3.EXE
  Browsers:
    Edge: Spartan (44.22621.1194.0), Chromium (109.0.1518.70)       
    Internet Explorer: 11.0.22621.1

If this is an issue with run order of tasks, please paste in the result of lage info [your command(s)] [options]

kenotron commented 1 year ago

Wow, this escaped me. Apologize - you do need to define a lage.config.js, specifically with a build task in the pipeline in order for this to work.

// @file lage.config.js
module.exports = {
  pipeline: {
    build: ["^build"]
  }
}
jeffrson commented 1 year ago

Is this a more general problem? I cannot even run npx lage init or npx lage info:

lage - Version 2.5.3 - 15 Workers
[16:00:09] - log       lage: no targets found that matches the given scope.

(just testing via https://microsoft.github.io/lage/docs/Quick%20Start)

niemyjski commented 1 year ago

@jeffrson probably, I ended up getting rid of lage for just vanilla npm workspaces.

albanx commented 4 months ago

Having the same issue after updating to v2.17 lage.config.js

module.exports = {
  "pipeline": {
    "build": [
      "^build"
    ],
    "build:ci": [
      "^build:ci"
    ],
    "build:polyfill": [],
    "lint": [],
    "test-integration": [],
    "test-integration:ci": [],
    "test-unit": [],
    "test-unit:ci": [],
  },
  "npmClient": "yarn"
};

Any resolution?

albanx commented 4 months ago

nvm, I was missing the custom command from the above config.

module.exports = {
  "pipeline": {
    "build": [
      "^build"
    ],
 "customcommand": [],
    "build:ci": [
      "^build:ci"
    ],
    "build:polyfill": [],
    "lint": [],
    "test-integration": [],
    "test-integration:ci": [],
    "test-unit": [],
    "test-unit:ci": [],
  },
  "npmClient": "yarn"
};