From 708d86702e8c5767e6d00a0996335dd274050847 Mon Sep 17 00:00:00 2001 From: Addy Pathania Date: Fri, 15 Mar 2024 10:43:27 -0400 Subject: [PATCH] fix retries type error --- .../templates/nextjs/src/lib/dictionary-service-factory.ts | 5 ++--- .../src/templates/nextjs/src/lib/layout-service-factory.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts index 5079b06129..9aa53dede7 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts +++ b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts @@ -37,9 +37,8 @@ export class DictionaryServiceFactory { By default it uses the `DefaultRetryStrategy` with exponential back-off factor of 2 and handles error codes 429, 502, 503, 504, 520, 521, 522, 523, 524, 'ECONNRESET', 'ETIMEDOUT' and 'EPROTO' . You can use this class or your own implementation of `RetryStrategy`. */ - retries: - process.env.GRAPH_QL_SERVICE_RETRIES && - parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10), + retries: (process.env.GRAPH_QL_SERVICE_RETRIES && + parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10)) as number, }) : new RestDictionaryService({ apiHost: config.sitecoreApiHost, diff --git a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts index 464eb2b3ee..84e92f8dc0 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts +++ b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts @@ -30,9 +30,8 @@ export class LayoutServiceFactory { By default it uses the `DefaultRetryStrategy` with exponential back-off factor of 2 and handles error codes 429, 502, 503, 504, 520, 521, 522, 523, 524, 'ECONNRESET', 'ETIMEDOUT' and 'EPROTO' . You can use this class or your own implementation of `RetryStrategy`. */ - retries: - process.env.GRAPH_QL_SERVICE_RETRIES && - parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10), + retries: (process.env.GRAPH_QL_SERVICE_RETRIES && + parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10)) as number, }) : new RestLayoutService({ apiHost: config.sitecoreApiHost,