Closed Michael-Xie closed 1 year ago
Noticed the same behaviour when I upgraded one older function from serverless-offline 8.8.x to 12.0.x
Noticed the same behaviour when I upgraded one older function from serverless-offline 8.8.x to 12.0.x
This issue occurred when I finished updating my packages too.
Same issue here after updating
Use the reloadHandler
flag.
I personally not sure what the considerations are around the flag but I'd prefer this to be enabled by default?
Just an FYI i'm also using serverless-webpack so that might why there's additional config reloadHandler
Use the reloadHandler flag.
I'm using serverless-esbuild
and this works in my case as well 🎉 ! Just sometimes I need to call the API 2 times for the reload to trigger.
To be clear I am starting the serverless-offline
cli service with this command now:
sls offline start --reloadHandler
Note! It does make the API call significantly slower: I have a function that scans a small DynamoDB table and returns the filtered results. This takes ~230ms for each call using the reloadHandler
flag. If I dont use that flag it takes ~25ms on subsequent calls. But this tradeoff is so much worth it for being able to hot reload the code!
Use the
reloadHandler
flag.
Thanks! Missed that one in the release notes.
Use the reloadHandler flag.
I'm using
serverless-esbuild
and this works in my case as well tada ! Just sometimes I need to call the API 2 times for the reload to trigger.To be clear I am starting the
serverless-offline
cli service with this command now:
sls offline start --reloadHandler
Note! It does make the API call significantly slower: I have a function that scans a small DynamoDB table and returns the filtered results. This takes ~230ms for each call using the
reloadHandler
flag. If I dont use that flag it takes ~25ms on subsequent calls. But this tradeoff is so much worth it for being able to hot reload the code!
Thanks this worked~! :+1:
Bug Report
Current Behavior
I have a lambda that returns a response by providing a POST request with specific parameters in the body. When I make a small code change, like renaming a variable or calculation within one line, the change won't be in effect when I invoke the lambda.
Sample Code
Expected behavior/code
I expect the saved code changes can be observed the next time I invoke the function containing them. Now, I have to restart sls offline to see the changes.
Environment
"serverless": "^3.25.0",
"serverless-offline": "^11.5.0",
"@serverless/typescript": "^3.21.0",
"@shelf/jest-mongodb": "^4.1.3",
"@types/aws-lambda": "^8.10.108",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"jest": "^29.3.1",
"json-schema-to-ts": "^2.6.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"serverless": "^3.25.0",
"serverless-webpack": "^5.11.0",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"ts-loader": "^9.4.1",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "^4.9.3",
"webpack": "^5.75.0",
"webpack-node-externals": "^3.0.0"
node.js
version: v16.17.0OS
: Ubuntu 19.04