microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.82k stars 592 forks source link

[rush] Running `rush rebuild` to run `rollup -c` causes a warning tip. #4824

Open zhangxuan615 opened 2 months ago

zhangxuan615 commented 2 months ago

Summary

The console always prints a warning tip(SUCCESS WITH WARNINGS...) if a sub-package has a build command: rollup -c, when I run rush rebuild in the root directory. What's even weirder is that it just says there's a warning, but it doesn't provide any details about the warning.

If I run directly the command (rollup -c) in the sub-package directory, no warning will be printed.

So, from my opinion, I just think there is incompatibility in rush and rollup.

Repro steps

  1. create a sub-package.
  2. install rollup in this sub-package.
  3. create a source file "./src/index.js". export const a = 1; console.log("test:", a)
  4. create a config file for rollup: rollup.config.js: module.exports = { input: "src/index.js" }
  5. add a script command in package.json: "build": "rollup -c".
  6. run run rebuild in the root directory.

Details

image

iclanton commented 1 month ago

I'm guessing rollup is printing something to stderr. Rush considers an operation successful with warnings if it exits with code 0 but also prints to stderr.

You should be able to see what specifically is getting printed to stderr by looking at the *.error.log file in the project's rush-logs folder (assuming you're on a recent version of Rush) or in the project root.

zhangxuan615 commented 1 month ago

@iclanton I tested it with a simplest demo by running rush init, and the version of rush I'm using is 5.129.6:

  1. there is no useful info in the *.error.log file. 8a6dec5aba72b06945e1ce264a34494
  2. there is no warning/error when I run the rollup -c directly in the sub-package directory. bb5667add57a65c0557f686274287f9