gpt4 book ai didi

node.js - 无服务器部署 : Recoverable error occurred (write ECONNRESET), 休眠约 5 秒。尝试 4 个中的 1 个

转载 作者:行者123 更新时间:2023-12-03 12:13:04 27 4
gpt4 key购买 nike

我一直在尝试在 Lambda 函数上使用 nodejs 部署我的 GraphQl Apollo Server,在无服务器离线状态下它运行良好,当我尝试部署它时失败并显示错误:
“发生可恢复错误(写入 ECONNRESET),休眠约 5 秒。尝试 4 中的 1”
Once the error appears, the console exits the proccess with no other message
一旦出现错误,控制台将退出进程,没有其他消息

我正在使用 Typescript 和 Webpack

我已经做了什么:

  • 验证所有依赖项和类型
  • 警告更正
  • 使用无服务器离线插件进行测试并在本地完美运行

  • yml文件:
    service: apollo-sever-kisbel

    custom:
    webpack:
    webpackConfig: ./webpack.config.js
    includeModules: true


    plugins:
    - serverless-webpack
    - serverless-offline

    provider:
    name: aws
    runtime: nodejs12.x
    stage: dev


    functions:
    graphql:
    handler: lib/index.graphqlHandler
    events:
    - http:
    path: "{proxy+}"
    method: any
    cors: true

    干杯!

    最佳答案

    如果您遇到无服务器网络问题,您可以在 CLI 中导出 AWS 变量以增加默认超时时间 export AWS_CLIENT_TIMEOUT=360000希望这对你将来有帮助;)

    关于node.js - 无服务器部署 : Recoverable error occurred (write ECONNRESET), 休眠约 5 秒。尝试 4 个中的 1 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61152565/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com