Internal error when hitting endpoint

未關閉
#17 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
aws, javascript, postgresql, webpack

研究方向

從 postgraphileOptions.js 和 CloudWatch 堆疊追蹤開始,特別檢查打包的 bindings,以及 libpq 和 pg-native 模組。重現手動設定的 Lambda 請求,並判定原生 PostgreSQL 相依性為何收到 undefined 值;當 gateway 端點在沒有此內部錯誤的情況下回應時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

I'm trying to get a manually-configured Lambda up using this example. When I hit the gateway API endpoint, I get this error in the CloudWatch logs:

 "TypeError: Cannot read property 'indexOf' of undefined",
        "    at Function.getFileName (webpack:///./node_modules/bindings/bindings.js?:178:16)",
        "    at bindings (webpack:///./node_modules/bindings/bindings.js?:82:48)",
        "    at Object.eval (webpack:///./node_modules/libpq/index.js?:1:147)",
        "    at eval (webpack:///./node_modules/libpq/index.js?:361:30)",
        "    at Object../node_modules/libpq/index.js (/var/task/index.js:3785:1)",
        "    at __webpack_require__ (/var/task/index.js:20:30)",
        "    at eval (webpack:///./node_modules/pg-native/index.js?:1:13)",
        "    at Object../node_modules/pg-native/index.js (/var/task/index.js:5848:1)",
        "    at __webpack_require__ (/var/task/index.js:20:30)",
        "    at eval (webpack:///./node_modules/pg/lib/native/client.js?:11:14)"

My postgraphileOptions.js are as follows:

exports.options = {
  dynamicJson: true,
  cors: true,
  graphiql: false,
  graphqlRoute: '/graphql',
  externalUrlBase: `/${process.env.AWS_STAGE}`,

  // If consuming JWT:
 // jwtSecret: process.env.JWT_SECRET || String(Math.random()),
  // If generating JWT:
  //jwtPgTypeIdentifier: process.env.JWT_PG_TYPE_IDENTIFIER,

  /* If you want to enable GraphiQL, you must use `externalUrlBase` so PostGraphile
   * knows where to tell the browser to find the assets.  Doing this is
   * strongly discouraged, you should use an external GraphQL client instead.

    graphiql: true,
    enhanceGraphiql: true,
    graphqlRoute: '/',
    graphiqlRoute: '/graphiql',
  */
};

I'd appreciate any help anyone could give.

主要語言
PLpgSQL
星號
144
分支
19
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

graphile/postgraphile-lambda-example 的其他 Issue

查看 graphile/postgraphile-lambda-example 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。