Open matusfaro opened 2 years ago
For others stumbling here with pnpm
:
Don't use serverless-patched
, use pnpm
to apply the patch directly onto serverless
like this:
package.json
:
"scripts": {
"deploy": "SERVERLESS_CLI=true serverless --debug",
},
"devDependencies": {
"serverless": "^2.72.2",
},
"pnpm": {
"patchedDependencies": {
"@serverless/cli@1.6.0": "patches/@serverless__cli@1.6.0.patch"
}
}
@serverless__cli@1.6.0.patch
:
diff --git a/src/Context.js b/src/Context.js
index 4fb9da9b8a10ba8bc4ff82adab17e9605bf6d53e..ea13d974159fc17203d9dfa7dd5930a1dc29c9fb 100644
--- a/src/Context.js
+++ b/src/Context.js
@@ -153,7 +153,11 @@ class CLI {
process.stdout.write(ansiEscapes.cursorShow)
if (!this.isStatusEngineActive()) {
console.log() // eslint-disable-line
- process.exit(0)
+ if (reason === 'error') {
+ process.exit(1)
+ } else {
+ process.exit(0)
+ }
return
}
return this.statusEngineStop(reason, message)
@@ -244,6 +248,10 @@ class CLI {
this._.entity = entity
}
+ if (!process.stdout.isTTY || !!process.env.SERVERLESS_CI) {
+ return;
+ }
+
// Loading dots
if (this._.status.loadingDotCount === 0) {
this._.status.loadingDots = `.`
Issue Summary
When using
serverless-patched
doesn't work with pnpm.Actual behavior
Calling
serverless-patched
seems to work as the note is printed. but the Deploying logs are still present:The
findUpSync
logic finds an unpatchedserverless
instance due topnpm
'snode_modules
structure.Expected behavior
Deploying ...
logs should not be printedSteps to reproduce
pnpm
withserverless-patched
Versions
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.Possible issues to address:
Note: running patched serverless binary.
insidebin/serverless-patched.ts
but add this log line to the patch@serverless+cli+1.5.3.patch
itself. It was very confusing to track down this issue because of this. Bonus: detect whether the patch is present.@serverless/cli
To be honest, the amount of work put into this workaround, it seems upstreaming is the best option unless they are hesitant to accept patches.