Appsync模拟器:TypeError:无法将未定义或无效转换为对象

发布于 2025-02-09 07:43:33 字数 863 浏览 3 评论 0原文

(我正在使用Machine Translation.sorry)

构建appsync的本地环境

  • 我正在使用无服务器框架无服务器dynamodb-lecal
  • -appsync-simulator
  • server-server-offline

,当我安装这些sls并使用“ SLS Offline启动时,我都会出现错误“

AppSync Simulator: TypeError: Cannot convert undefined or null to object

顺便说一句,我正在使用打字稿而不是yml来创建一个项目

//appsync
"appsync-simulator": {
  location: ".esbuild/.build",
  watch: false,
},

//dynamoDB
dynamodb: {
  stages: "dev",
  start : {
    port: 8000,
    inMemory: true,
  // migrate: true, 
  // seed: true, 
  }
},

//esbuild
esbuild: {
  bundle: true,
  minify: false,
  sourcemap: true,
  exclude: ["aws-sdk"],
  target: "node14",
  define: { "require.resolve": undefined },
  platform: "node",
  concurrency: 10,
},

schema.graphql在根 而且该项目在AWS管理控制台

团队开发中运行良好,需要离线 请帮我

(I am using machine translation.sorry)

I'm building a local environment for appsync using a serverless framework

  • Serverless-dynamodb-local
  • Serverless-appsync-simulator
  • Serverless-offline

I got an error when I installed these and used the "sls offline start" command

AppSync Simulator: TypeError: Cannot convert undefined or null to object

By the way, I'm using typescript instead of yml to create a project

//appsync
"appsync-simulator": {
  location: ".esbuild/.build",
  watch: false,
},

//dynamoDB
dynamodb: {
  stages: "dev",
  start : {
    port: 8000,
    inMemory: true,
  // migrate: true, 
  // seed: true, 
  }
},

//esbuild
esbuild: {
  bundle: true,
  minify: false,
  sourcemap: true,
  exclude: ["aws-sdk"],
  target: "node14",
  define: { "require.resolve": undefined },
  platform: "node",
  concurrency: 10,
},

schema.graphql is at the root
And this project works fine in the AWS Management Console

Team development requires offline
Please help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一口甜 2025-02-16 07:43:33

抱歉,这个问题已经解决
这是一个“无服务器 - 应用程序模拟器”和“ cfn-Resolver-lib”依赖项问题

 "cfn-resolver-lib": "^1.1.8" →  "cfn-resolver-lib": "^1.1.7"

降级“ CFN-Resolver-lib”

,谢谢。

sorry, this issue has been resolved
It was a "serverless-appsync-simulator" and "cfn-resolver-lib" dependency issue

 "cfn-resolver-lib": "^1.1.8" →  "cfn-resolver-lib": "^1.1.7"

Downgrade “cfn-resolver-lib”

Thanks guys!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文