CodeGenieApp / CodeGenieApp/serverless-express

simple express api calling external end point through fetch failing with TypeError: o is not a function

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

説明

Hi
I followed examples/basic-starter-api-gateway-v1 setup and updated app.js to include a new endpoint definition that uses fetch to call an external end point , external rest endpoint implemented within express returns a json response ( verified through postman ). However the fetch call is throwing this error ( zip of the root folder that includes my app.js is attached
[my-serverless-express.zip](https://github.com/vendia/serverless-express/files/6713379/my-serverless-express.zip)
)
*******************************************************************
2021-06-24T04:30:31.822Z aa7e4631-258c-4ed2-9ae0-b410af797e86 INFO TypeError: o is not a function
at fn (/var/task/webpack:/@vendia/serverless-express-example/src/app.js:102:28)
at r.handle_request (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/layer.js:95:5)
at next (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/route.js:137:13)
at p.fn [as dispatch] (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/route.js:112:3)
at r.handle_request (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/layer.js:95:5)
at done (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/index.js:281:22)
at Function.process_params (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/index.js:335:12)
at next (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/index.js:275:10)
at fn (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/middleware/init.js:40:5)
at r.handle_request (/var/task/webpack:/@vendia/serverless-express-example/node_modules/express/lib/router/layer.js:95:5)
********************************************************

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

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

調査の方向性

examples/basic-starter-api-gateway-v1 と添付された app.js を調査し、特に stack trace に示されている 102 行目の endpoint を確認してください。Postman で検証された Express endpoint と比較し、外部の fetch 呼び出しで TypeError が発生する理由を追跡してください。fetch を使用する route が正常に実行され、期待される JSON レスポンスを返せば完了です。

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

評価

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

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

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