-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug?]: I used this.cli.run([this.commandName, ...this.args], this.context);, but the console does not output correctly #3354
Comments
Sounds like #3334, do you get exit code 0 when you run it manually? |
Does manual operation mean running on the wrong module? Yes, it will display a red error and terminate |
No, if you run the command in your terminal instead of using |
$ yarn workspaces foreach --include @liuli-util/i18next-util --parallel --topological-dev run setup
➤ YN0000: (node:21180) UnhandledPromiseRejectionWarning: Error: C:/Users/rxliuli/Code/Pkg/liuli-tools/libs/i18next-util/src/index.ts(2,1): semantic error TS2304: Cannot find name 'sd'.
➤ YN0000: at error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:151:30)
➤ YN0000: at throwPluginError (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:19344:12)
➤ YN0000: at Object.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:20013:20)
➤ YN0000: at Object.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:19520:38)
➤ YN0000: at RollupContext.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:17241:30)
➤ YN0000: at C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:25064:23
➤ YN0000: at arrayEach (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:549:11)
➤ YN0000: at Function.forEach (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:9401:14)
➤ YN0000: at printDiagnostics (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:25037:12)
➤ YN0000: at Object.transform (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:30131:17)
➤ YN0000: (Use `node --trace-warnings ...` to show where the warning was created)
➤ YN0000: (node:21180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
➤ YN0000: (node:21180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
➤ YN0000: Done in 3s 874ms
$ yarn changed foreach --include @liuli-util/i18next-util -p --topological-dev run setup
计算得到变更的模块:
@liuli-util/i18next-util
execute before: workspaces foreach --include @liuli-util/i18next-util --parallel --topological-dev run setup
➤ YN0000: (node:37240) UnhandledPromiseRejectionWarning: Error: C:/Users/rxliuli/Code/Pkg/liuli-tools/libs/i18next-util/src/index.ts(2,1): semantic error TS2304: Cannot find name 'sd'.
➤ YN0000: at error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:151:30)
➤ YN0000: at throwPluginError (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:19344:12)
➤ YN0000: at Object.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:20013:20)
➤ YN0000: at Object.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup\dist\shared\rollup.js:19520:38)
➤ YN0000: at RollupContext.error (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:17241:30)
➤ YN0000: at C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:25064:23
➤ YN0000: at arrayEach (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:549:11)
➤ YN0000: at Function.forEach (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:9401:14)
➤ YN0000: at printDiagnostics (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:25037:12)
➤ YN0000: at Object.transform (C:\Users\rxliuli\Code\Pkg\liuli-tools\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:30131:17)
➤ YN0000: (Use `node --trace-warnings ...` to show where the warning was created)
➤ YN0000: (node:37240) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
➤ YN0000: (node:37240) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
➤ YN0000: Done in 3s 773ms
execute after: 0 |
Looks like a problem with |
I added a reproducible example Steps to reproduce
In order to see the actual executed command, I printed it out and can execute it yarn workspaces foreach --include @liuli-util/i18next-util --parallel --topological-dev run setup |
As I mentioned on Discord, your screenshot shows a warning not an error. When I run it on Node 16 I do get an error and See https://nodejs.org/dist/latest/docs/api/deprecations.html#deprecations_dep0018_unhandled_promise_rejections |
Is there a way to make it correct on nodejs 14? After all, now 14 is still a long-term support version |
Yes, read the docs I linked to. This isn't a Yarn issue |
Self-service
Describe the bug
When there is an error, it will not return 1
To reproduce
yarn changed foreach run build
https://github.com/rxliuli/liuli-tools/blob/586446ad046b3d5a4b3ad79c53777869131f5d4d/libs/yarn-plugin-changed/src/commands/ChangedForeachCommand.ts#L32
Environment
System:
OS: Windows 10 10.0.19043
CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
Binaries:
Node: 14.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.11 - C:\Program Files\nodejs\yarn.CMD
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
Additional context
No response
The text was updated successfully, but these errors were encountered: