Closed feline-dis closed 2 years ago
@JonathanHansen98 stack trace shows that you do not run the latest version of serverless-offline
, please upgrade
@medikoo where do you see this? I just confirmed the version in my package.json
is at 8.3.0
which seems to be the latest version according to the documentation. I tried deleting my package-lock.json
and node_modules
and running npm i
just in case, but I'm still running into the same issues.
@JonathanHansen98 top line from stack trace, doesn't match latest version. It's:
at DockerContainer._downloadLayer (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\lambda\handler-runner\docker-runner\DockerContainer.js:335:19)
While when you inspect latest version (at e.g. https://npmview.vercel.app/serverless-offline) you'll there's no property access at L335 of DockerContainer.js
Ohhh my gosh, thats totally my bad. I added some logs while at my wits end last night that messed with the line numbers causing a little misalignment there, sorry.
This is the stack trace after a clean install of the package with none of my logs to mess it up:
offline: Failure: Cannot read properties of undefined (reading 'notice')
TypeError: Cannot read properties of undefined (reading 'notice')
at DockerContainer._downloadLayer (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\lambda\handler-runner\docker-runner\DockerContainer.js:332:19)
at DockerContainer.start (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\lambda\handler-runner\docker-runner\DockerContainer.js:225:30)
at async DockerRunner.run (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\lambda\handler-runner\docker-runner\DockerRunner.js:66:7)
at async LambdaFunction.runHandler (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\lambda\LambdaFunction.js:368:20)
at async hapiHandler (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\serverless-offline\dist\events\http\HttpServer.js:702:18)
at async exports.Manager.execute (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\@hapi\hapi\lib\toolkit.js:60:28)
at async Object.internals.handler (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\@hapi\hapi\lib\handler.js:46:20)
at async exports.execute (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\@hapi\hapi\lib\handler.js:31:20)
at async Request._lifecycle (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\@hapi\hapi\lib\request.js:371:32)
at async Request._execute (D:\dev\nerd-power\microservices\v2\opportunity-microservice\node_modules\@hapi\hapi\lib\request.js:281:9)
The real line in question is L332 of DockerContainer.js
, it seems like its having an issue initiating the layerProgress
variable.
Once, again sorry for the confusion there 😅
@JonathanHansen98 thanks for pointing, indeed there's a clear bug there, fix is coming
Hello! I have the following
serverless.yml
file and am running into some issues when trying to use the--useDocker
option.I am able make a request and start the function, however I receive the following errors:
Any help/info would be much appreciated, I'm not sure how else to pass the layers to the function. Ive tried passing them at the provider level however it doesn't seem to recognize the layers at all when I try that approach.
Serverless Version: Framework Core: 2.66.2 (local) Plugin: 5.5.1 SDK: 4.3.0 Components: 3.18.1
serverless-offline Version: "^8.3.0"