Skip to content

Commit a4f11bc

Browse files
committed
fix(nextjs-component): create AWS resources for dynamic SSG (serverless-nextjs#1476)
1 parent a5d74d2 commit a4f11bc

File tree

1 file changed

+5
-2
lines changed
  • packages/serverless-components/nextjs-component/src

1 file changed

+5
-2
lines changed

packages/serverless-components/nextjs-component/src/component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ class NextjsComponent extends Component {
451451
typeof defaultBuildManifest.pages.ssg.nonDynamic[key]
452452
.initialRevalidateSeconds === "number"
453453
);
454+
const hasDynamicISRPages = Object.keys(
455+
defaultBuildManifest.pages.ssg.dynamic
456+
).some((key) => defaultBuildManifest.pages.ssg.dynamic[key].fallback !== false);
454457

455458
const readLambdaInputValue = (
456459
inputKey: "memory" | "timeout" | "name" | "runtime" | "roleArn" | "tags",
@@ -471,7 +474,7 @@ class NextjsComponent extends Component {
471474
};
472475

473476
let queue;
474-
if (hasISRPages) {
477+
if (hasISRPages || hasDynamicISRPages) {
475478
queue = await sqs({
476479
name: `${bucketOutputs.name}.fifo`,
477480
deduplicationScope: "messageGroup",
@@ -521,7 +524,7 @@ class NextjsComponent extends Component {
521524
}
522525
}
523526

524-
if (hasISRPages) {
527+
if (hasISRPages || hasDynamicISRPages) {
525528
const regenerationLambdaInput: LambdaInput = {
526529
region: bucketRegion, // make sure SQS region and regeneration lambda region are the same
527530
description: inputs.description

0 commit comments

Comments
 (0)