-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logger doesn't work #651
Comments
I have around 50 APIs built using @vendia/serverless-express and all of them stopped working suddenly after a redeployment. After spending a day troubleshooting, I found out that the logger.js has been changed in the latest version to use "...additional.map(lazyPrint)". This was causing following error when invoking the API: I will revert back to version 4.10.1 for now, but above error is a blocker issue for the latest version. My lambda hander code is as below: |
* fix(logger): fix regression #651 * fix(types): better types for logger
@create1st @anishsam thanks for the report. This should be fixed in 4.10.4 thanks to @H4ad |
Thank you |
<p>This PR was automatically created by Snyk using the credentials of a real user.</p><br /><h3>Snyk has created this PR to upgrade @vendia/serverless-express from 4.10.1 to 4.10.4.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **3 versions** ahead of your current version. - The recommended version was released **a month ago**, on 2023-05-21. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>@vendia/serverless-express</b></summary> <ul> <li> <b>4.10.4</b> - <a href="https://snyk.io/redirect/github/vendia/serverless-express/releases/tag/v4.10.4">2023-05-21</a></br><h2><a href="https://snyk.io/redirect/github/vendia/serverless-express/compare/v4.10.3...v4.10.4">4.10.4</a> (2023-05-21)</h2> <h3>Bug Fixes</h3> <ul> <li>logging (<a href="https://snyk.io/redirect/github/vendia/serverless-express/issues/652" data-hovercard-type="pull_request" data-hovercard-url="/CodeGenieApp/serverless-express/pull/652/hovercard">#652</a>) (<a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/dfcb71a59b29f1249cd1f8f58476620ef0f276a4">dfcb71a</a>), closes <a href="https://snyk.io/redirect/github/vendia/serverless-express/issues/651" data-hovercard-type="issue" data-hovercard-url="/CodeGenieApp/serverless-express/issues/651/hovercard">#651</a></li> </ul> </li> <li> <b>4.10.3</b> - <a href="https://snyk.io/redirect/github/vendia/serverless-express/releases/tag/v4.10.3">2023-05-08</a></br><h2><a href="https://snyk.io/redirect/github/vendia/serverless-express/compare/v4.10.2...v4.10.3">4.10.3</a> (2023-05-08)</h2> <h3>Bug Fixes</h3> <ul> <li>upgrade json5 dependency (<a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/f20ec470c1d436a955972c172a752fa62614e286">f20ec47</a>)</li> </ul> </li> <li> <b>4.10.2</b> - <a href="https://snyk.io/redirect/github/vendia/serverless-express/releases/tag/v4.10.2">2023-05-07</a></br><h2><a href="https://snyk.io/redirect/github/vendia/serverless-express/compare/v4.10.1...v4.10.2">4.10.2</a> (2023-05-07)</h2> <h3>Performance Improvements</h3> <ul> <li><strong>logger:</strong> defer execution of expensive logging calls (<a href="https://snyk.io/redirect/github/vendia/serverless-express/issues/614" data-hovercard-type="pull_request" data-hovercard-url="/CodeGenieApp/serverless-express/pull/614/hovercard">#614</a>) (<a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/7d42c6d55cb9c27d6ace81f62b3f90d882480d35">7d42c6d</a>)</li> </ul> </li> <li> <b>4.10.1</b> - <a href="https://snyk.io/redirect/github/vendia/serverless-express/releases/tag/v4.10.1">2022-07-26</a></br><h2><a href="https://snyk.io/redirect/github/vendia/serverless-express/compare/v4.10.0...v4.10.1">4.10.1</a> (2022-07-26)</h2> <h3>Bug Fixes</h3> <ul> <li><strong>http-function-runtime-v3:</strong> fix undeclared variable and added improve tests for set-cookie (<a href="https://snyk.io/redirect/github/vendia/serverless-express/issues/534" data-hovercard-type="pull_request" data-hovercard-url="/CodeGenieApp/serverless-express/pull/534/hovercard">#534</a>) (<a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/34bd7da3fa20d754a98a59324a2bf7dc1e73a30c">34bd7da</a>)</li> </ul> </li> </ul> from <a href="https://snyk.io/redirect/github/vendia/serverless-express/releases">@vendia/serverless-express GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>@vendia/serverless-express</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/75e9de327972ad372a89cd7ae586b53c73c048f0">75e9de3</a> chore(release): 4.10.4 [skip ci]</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/dfcb71a59b29f1249cd1f8f58476620ef0f276a4">dfcb71a</a> fix: logging (#652)</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/d5246a7885561eb055ad74c22b0368cc2d54efe7">d5246a7</a> chore(release): 4.10.3 [skip ci]</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/f20ec470c1d436a955972c172a752fa62614e286">f20ec47</a> fix: upgrade json5 dependency</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/acdcbd65d04edbce14f9c9c917191538b9138cc7">acdcbd6</a> chore: revert update dependencies</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/41f6dc8573b41a52476823c00a780dc4fc36195f">41f6dc8</a> chore: update dependencies</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/79d030c45e3fb32226fd2be7daf2460f8344723f">79d030c</a> docs: remove contributor covenant badge</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/dbc64fa44045b66fe669282a9a4fdcbbe6d003b1">dbc64fa</a> docs: update readme</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/649eca084ebbbb1710cfd6e6141e728182bea2c8">649eca0</a> docs: update Vendia logo</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/89f2b4faa507a98c47da58dc64686c3dbcb7f924">89f2b4f</a> chore: export ConfigureResult interface (#584)</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/d45fdd2fda8c347b54e75f6c19ed48e258e5f88e">d45fdd2</a> chore(release): 4.10.2 [skip ci]</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/7d42c6d55cb9c27d6ace81f62b3f90d882480d35">7d42c6d</a> perf(logger): defer execution of expensive logging calls (#614)</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/0909ec4ffd09d9fd22538257b721b7d076d03732">0909ec4</a> ci: add nodejs18.x to test matrix; update examples to use 18.x</li> <li><a href="https://snyk.io/redirect/github/vendia/serverless-express/commit/75cfbffeb3fd030695b9587a75300c7b8012ac6a">75cfbff</a> chore(deps): Bump moment-timezone in /examples/basic-starter-nestjs (#550)</li> </ul> <a href="https://snyk.io/redirect/github/vendia/serverless-express/compare/19874846dec30ad1101ed73f794c3a8a74c85700...75e9de327972ad372a89cd7ae586b53c73c048f0">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI2ZWZiM2NmZi1jZmMwLTQxNzktYWYwZi0yZWQ5Y2M2Nzc2NDkiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjZlZmIzY2ZmLWNmYzAtNDE3OS1hZjBmLTJlZDljYzY3NzY0OSJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/manuelfidalgo/project/1e476a2c-f968-4574-8a48-a93a0982eecc?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/manuelfidalgo/project/1e476a2c-f968-4574-8a48-a93a0982eecc/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/manuelfidalgo/project/1e476a2c-f968-4574-8a48-a93a0982eecc/settings/integration?pkg=@vendia/serverless-express&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"6efb3cff-cfc0-4179-af0f-2ed9cc677649","prPublicId":"6efb3cff-cfc0-4179-af0f-2ed9cc677649","dependencies":[{"name":"@vendia/serverless-express","from":"4.10.1","to":"4.10.4"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/manuelfidalgo/project/1e476a2c-f968-4574-8a48-a93a0982eecc?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"1e476a2c-f968-4574-8a48-a93a0982eecc","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":3,"publishedDate":"2023-05-21T22:25:47.789Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <snyk-bot@snyk.io> Co-authored-by: van Basten 17 <35448568+vanbasten17@users.noreply.github.com>
The logger function incorrectly assumes that you provide additional information and fails since a call to the logger in debug mode doesn't always carry additional information.
/Users/create/work/lambda-sns/node_modules/@vendia/serverless-express/src/logger.js:43 ...additional.map(lazyPrint) ^ TypeError: Cannot read properties of undefined (reading 'map') at Object.debug (/Users/create/work/lambda-sns/node_modules/@vendia/serverless-express/src/logger.js:43:23) at getFramework (/Users/create/work/lambda-sns/node_modules/@vendia/serverless-express/src/frameworks/index.js:13:9)
The text was updated successfully, but these errors were encountered: