Chaitanya Bapat :
I am trying to test the serverless lambda function using the command
Command
serverless invoke local -f send --log --stage test
Error
TypeError: chalk(...).dim is not a function
Entire stacktrace:
Type Error ---------------------------------------------
TypeError: chalk(...).dim is not a function
at /snapshot/serverless/lib/Serverless.js:83:47
at /snapshot/serverless/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
From previous event:
at Serverless.init (/snapshot/serverless/lib/Serverless.js:72:8)
at /snapshot/serverless/bin/serverless.js:74:8
at processImmediate (internal/timers.js:439:21)
at process.topLevelDomainCallback (domain.js:130:23)
From previous event:
at Object.<anonymous> (/snapshot/serverless/bin/serverless.js:64:4)
at Module._compile (pkg/prelude/bootstrap.js:1261:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:993:10)
at Module.load (internal/modules/cjs/loader.js:813:32)
at Function.Module._load (internal/modules/cjs/loader.js:725:14)
at Function.Module.runMain (pkg/prelude/bootstrap.js:1316:12)
at internal/main/run_main_module.js:17:11
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 12.13.1
Framework Version: 1.64.0 (standalone)
Plugin Version: 3.4.0
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0
This command is run inside the directory which has serverless.yml, requirements.txt, handler.py.
Unable to understand why this error occurs and what's the solution
Aaron Stuyvenberg :
I believe this is a bug in the Standalone version of the Serverless Framework.
I've opened a PR to address this https://github.com/serverless/serverless/pull/7412
In the meantime, this bug is caused by the fact that Serverless Framework v1.65.0 was just released. You can resolve this by upgrading, which will cause this erroneous codepath to not be called.
Thanks!