jetbridge / cdk-nextjs

Deploy a NextJS application using AWS CDK
https://constructs.dev/packages/cdk-nextjs-standalone
Apache License 2.0
273 stars 45 forks source link

bug: cdk destroy fails when open-next build is not present #175

Closed onhate closed 9 months ago

onhate commented 10 months ago

I'm building a container that clones a git repository and either deploy or destroy an environment, and when I try to destroy one the cdk command fails because the open-next build is not present.

Warning: /.../.open-next does not exist

{\n  errno: -2,\n  code: 'ENOENT',\n  syscall: 'spawnSync /bin/sh',\n  path: '/bin/sh',\n  spawnargs: [\n    '-c',\n    \"zip -ryq9 '/tmp/cdk-nextjs-archive-eTvNse/server-fn.zip' .\"\n  ],\n  error: [Circular *1],\n  status: null,\n  signal: null,\n  output: null,\n  pid: 0,\n  stdout: null,\n  stderr: null\n}

P.S.: this is issue is just for tracking, I'll work on a PR for it.

bestickley commented 10 months ago

@onhate, so basically you want to be able to run cdk destroy without a Nextjs site being previously built/deployed?

onhate commented 10 months ago

yes, exactly.