CodeGenieApp / CodeGenieApp/serverless-express

TypeError: Cannot read property 'callback' of undefined

オープン
#485 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
5.3k
フォーク
676
PR マージ指標
30日以内にマージされた PR はありません

説明

```
const { getCurrentInvoke } = require('@vendia/serverless-express')
app.get('/', (req, res) => {
const { event, context } = getCurrentInvoke()

res.json(event)
})
```

What is wrong about the code above? I'm getting the following error:

```
TypeError: Cannot read property 'callback' of undefined
at getFramework (/my-app/node_modules/@vendia/serverless-express/src/frameworks/index.js:7:18)
at configure (/my-app/node_modules/@vendia/serverless-express/src/configure.js:22:35)
at ResizeToThreeDimensionsController.handle (/my-app/src/adapters/resizeToThreeDimensionsController.ts:81:40)
at Layer.handle [as handle_request] (/my-app/node_modules/express/lib/router/layer.js:95:5)
at next (/my-app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/my-app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/my-app/node_modules/express/lib/router/layer.js:95:5)
at /my-app/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/my-app/node_modules/express/lib/router/index.js:341:12)
at next (/my-app/node_modules/express/lib/router/index.js:275:10)
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、スタックトレースと示されている Express ルートをエントリーポイントとして、src/frameworks/index.js と src/configure.js を通る getCurrentInvoke の呼び出しを追跡します。この使用方法で framework configuration が undefined になる理由を特定し、修正した invocation を検証して、ルートが TypeError なしで現在の event を返すことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, express, javascript, node.js
領域
api, backend, cloud
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。