Skip to content

🎥 Make videos programmatically with React

git AWS wrong bucket return detection

Jonny Burger1de7998efe33
diff --git a/packages/lambda/src/api/get-buckets.ts b/packages/lambda/src/api/get-buckets.ts
index 24fd440adf..801a505031 100644
--- a/packages/lambda/src/api/get-buckets.ts
+++ b/packages/lambda/src/api/get-buckets.ts
@@ -43,7 +43,7 @@ export const getRemotionS3Buckets = async (
return result.LocationConstraint ?? ('us-east-1' as AwsRegion);
} catch (err) {
// Sometimes the API returns a bucket even if it was deleted before
- if ((err as Error).message.includes('NoSuchBucket')) {
+ if ((err as Error).stack?.includes('NoSuchBucket')) {
return null;
}