You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command npx sls deploy --conceal with the following environment variables set failed with the titular error message. After some hacking and searching I think I found the source of the problem, and I'd send in a PR however I'm not yet sure the correct multi-platform solution.
Serverless-Webpack Version you're using: "serverless-webpack": "^5.3.1"
Webpack version you're using: "webpack": "^4.29.0"
Serverless Framework Version you're using: "serverless": "^1.69.0"
Operating System: Kubuntu 18.04.3 (equivalent to Ubuntu 18.04.3 LTS)
Stack Trace (if available):
...
Serverless: Invoke webpack:package
Syntax Error -------------------------------------------
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at /home/ricky/data/dev_slidewave/serverless/node_modules/serverless-webpack/lib/packagers/npm.js:75:19
at tryCatcher (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/method.js:39:29)
at /home/ricky/data/dev_slidewave/serverless/node_modules/serverless-webpack/lib/packagers/npm.js:73:35
at tryCatcher (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/ricky/data/dev_slidewave/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:456:21)
at process.topLevelDomainCallback (domain.js:137:15)
Your Environment Information ---------------------------
Operating System: linux
Node Version: 13.14.0
Framework Version: 1.69.0
Plugin Version: 3.6.9
SDK Version: 2.3.0
Components Version: 2.30.4
As I said I did some digging and it seems that there's a buffering problem with the output of npm ls.
Manual execution of npm ls -prod -json -depth=1 > npmls.json results in npmls.txt.
So I utilized a concept from SO, though the unbuffer command isn't preinstalled on my system so I skipped the accepted answer's solution, and the stdbuf command didn't solve the problem. I modified npm.js::getProdDependencies as follows:
constcommand="script";constargs=['-q','-c',`${/^win/.test(process.platform) ? 'npm.cmd' : 'npm'} ls -prod -json -depth=${depth||1}`,'/dev/null'];
Which, while having broad Linux support, won't work on BSD-based platforms or Windows. After making that change that error is resolved and I can proceed to the next problem to solve.
Thus this issue report: I found a solution, but it's not a good solution.
The text was updated successfully, but these errors were encountered:
Funny thing was that just yesterday I spent the whole day trying to figure out why a spawn call in my own code wasn't getting anything on stdin or sending anything on stdout, wound up anbanding spawn for an alternative I was able to get away with: the command I was calling was just another TypeScript module, so I refactored its core into a library module and called that via import instead of spawning a whole process. But I digress.
This is a Bug Report
Description
The command
npx sls deploy --conceal
with the following environment variables set failed with the titular error message. After some hacking and searching I think I found the source of the problem, and I'd send in a PR however I'm not yet sure the correct multi-platform solution.My config:
NODE_ENV=staging
TS_NODE_PROJECT=webpack/tsconfig-for-webpack-config.json
And several other things in my config that I'm nearly 100% sure are not relevant to the problem at hand.
Similar or dependent issue(s):
Additional Data
"serverless-webpack": "^5.3.1"
"webpack": "^4.29.0"
"serverless": "^1.69.0"
As I said I did some digging and it seems that there's a buffering problem with the output of npm ls.
Manual execution of
npm ls -prod -json -depth=1 > npmls.json
results in npmls.txt.So I utilized a concept from SO, though the
unbuffer
command isn't preinstalled on my system so I skipped the accepted answer's solution, and thestdbuf
command didn't solve the problem. I modifiednpm.js::getProdDependencies
as follows:Which, while having broad Linux support, won't work on BSD-based platforms or Windows. After making that change that error is resolved and I can proceed to the next problem to solve.
Thus this issue report: I found a solution, but it's not a good solution.
The text was updated successfully, but these errors were encountered: