diff --git a/packages/checkout/sdk/src/sdk.ts b/packages/checkout/sdk/src/sdk.ts index 9b8f8a52c5..d2710b0d06 100644 --- a/packages/checkout/sdk/src/sdk.ts +++ b/packages/checkout/sdk/src/sdk.ts @@ -77,7 +77,7 @@ import { isMatchingAddress } from './utils/utils'; import * as wallet from './wallet'; import { WidgetConfiguration } from './widgets/definitions/configurations'; import { getWidgetsEsmUrl, loadUnresolvedBundle } from './widgets/load'; -import { determineWidgetsVersion, getLatestVersionFromNpm, validateAndBuildVersion } from './widgets/version'; +import { determineWidgetsVersion, getLatestVersion, validateAndBuildVersion } from './widgets/version'; import { globalPackageVersion } from './env'; import { AssessmentResult, fetchRiskAssessment, isAddressSanctioned } from './riskAssessment'; @@ -274,9 +274,9 @@ export class Checkout { try { return await tryLoadEsModule(validVersion); } catch (err: any) { - const latestVersion = await getLatestVersionFromNpm(); + const latestVersion = await getLatestVersion(); - if (validVersion === latestVersion) { + if (validVersion === latestVersion && validVersion !== 'latest') { try { return await tryLoadEsModule('latest'); } catch (retryErr: any) {