@faststore/core 4.5.0-dev.5 → 4.5.0-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.5.0-dev.4 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.5.0-dev.5 generate /home/runner/work/faststore/faststore/packages/core
3
3
  > pnpm run gen-types && pnpm run cache-graphql
4
4
 
5
5
 
6
- > @faststore/core@4.5.0-dev.4 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.5.0-dev.5 gen-types /home/runner/work/faststore/faststore/packages/core
7
7
  > node ../cli/bin/run generate-types .
8
8
 
9
9
  [STARTED] Parse Configuration
@@ -19,7 +19,7 @@
19
19
  [COMPLETED] Generate to /home/runner/work/faststore/faststore/packages/core/@generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.5.0-dev.4 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.5.0-dev.5 cache-graphql /home/runner/work/faststore/faststore/packages/core
23
23
  > node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
24
24
 
25
25
  [Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
@@ -1,11 +1,11 @@
1
1
 
2
- > @faststore/core@4.5.0-dev.4 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.5.0-dev.5 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
6
6
   RUN  v4.0.7 /home/runner/work/faststore/faststore/packages/core
7
7
 
8
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 38ms
8
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (5 tests) 28ms
9
9
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
10
10
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=8199d03debb0a6751ec53d8ee8987b78d0292acb
11
11
   at node:internal/deps/undici/undici:16416:13
@@ -35,10 +35,9 @@
35
35
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
36
36
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
37
37
 
38
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 276ms
39
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 2269ms
40
- ✓ shows an error state when the list fails to load  428ms
41
- ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  420ms
38
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 311ms
39
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (13 tests) 1942ms
40
+ ✓ shows an error state when the list fails to load  487ms
42
41
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
43
42
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
44
43
 
@@ -220,6 +219,7 @@ act(() => {
220
219
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
221
220
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
222
221
 
222
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 34ms
223
223
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > shows service unavailable when the login request fails
224
224
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
225
225
 
@@ -268,10 +268,14 @@ act(() => {
268
268
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
269
269
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
270
270
 
271
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (6 tests) 43ms
272
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1568ms
273
- ✓ renders the password protection form  617ms
274
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 52ms
271
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 2030ms
272
+ ✓ renders the password protection form  836ms
273
+ ✓ posts the password and redirects to the requested return path  316ms
274
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 1955ms
275
+ ✓ renders the menu view with contract details and manage footer  957ms
276
+ ✓ opens the contract switcher and returns to the menu on back  413ms
277
+ ✓ resets to the menu when the drawer closes  310ms
278
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 46ms
275
279
  stderr | test/sdk/localization/store-url.browser.test.ts
276
280
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
277
281
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:121:27)
@@ -279,12 +283,9 @@ This ensures that you're testing the behavior the user would see in the browser.
279
283
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
280
284
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
281
285
 
282
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 17ms
283
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (5 tests) 2247ms
284
- ✓ renders the menu view with contract details and manage footer  1249ms
285
- ✓ opens the contract switcher and returns to the menu on back  505ms
286
- ✓ resets to the menu when the drawer closes  303ms
287
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 85ms
286
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 32ms
287
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 71ms
288
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 34ms
288
289
  stderr | test/components/account/doLogout.browser.test.ts
289
290
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
290
291
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:121:27)
@@ -292,9 +293,8 @@ This ensures that you're testing the behavior the user would see in the browser.
292
293
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
293
294
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
294
295
 
295
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (4 tests) 47ms
296
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 45ms
297
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 263ms
296
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 43ms
297
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (3 tests) 280ms
298
298
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
299
299
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
300
300
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:121:27)
@@ -302,12 +302,12 @@ This ensures that you're testing the behavior the user would see in the browser.
302
302
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
303
303
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
304
304
 
305
- ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 8ms
306
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 243ms
305
+ ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (1 test) 9ms
306
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (3 tests) 338ms
307
307
  ✓  browser  test/utils/isLocalHost.browser.test.ts (3 tests) 5ms
308
308
  ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 19ms
309
309
  ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 3ms
310
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 31ms
310
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 42ms
311
311
  stderr | test/sdk/account/refreshToken.browser.test.ts
312
312
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
313
313
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:121:27)
@@ -315,11 +315,11 @@ This ensures that you're testing the behavior the user would see in the browser.
315
315
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:354:23)
316
316
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
317
317
 
318
- ✓  node  test/utils/match-url.test.ts (10 tests) 9ms
319
318
  ✓  browser  test/sdk/account/refreshToken.browser.test.ts (1 test) 5ms
320
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 14ms
321
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 223ms
322
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 10ms
319
+ ✓  node  test/utils/match-url.test.ts (10 tests) 8ms
320
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 16ms
321
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 308ms
322
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 11ms
323
323
  stderr | test/components/search/SearchInputComponent.test.tsx
324
324
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
325
325
 
@@ -383,22 +383,23 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
383
383
  at Suspense
384
384
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
385
385
 
386
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 82ms
387
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 14ms
388
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 51ms
389
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 22ms
390
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 356ms
386
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 73ms
387
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 59ms
388
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 11ms
389
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 23ms
391
390
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
392
391
  Set password request failed: Bad Request
393
392
 
394
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 46ms
393
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 38ms
394
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (12 tests) 365ms
395
395
  ✓  node  test/components/quotes/quoteFilters.test.ts (23 tests) 25ms
396
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
397
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 5ms
398
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 840ms
399
- ✓ navigates with the search term on blur  362ms
400
- ✓ navigates without a label param when the search is cleared  363ms
401
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 46ms
396
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 7ms
397
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (9 tests) 835ms
398
+ ✓ navigates with the search term on blur  360ms
399
+ ✓ navigates without a label param when the search is cleared  358ms
400
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
401
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 43ms
402
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 44ms
402
403
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
403
404
  Graphql execution returned with error: [
404
405
  {
@@ -445,46 +446,47 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
445
446
  { message: 'bad', status: 400, type: 'BadRequestError' }
446
447
  ]
447
448
 
448
- ✓  node  test/pages/api/graphql.test.ts (10 tests) 24ms
449
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 53ms
450
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 63ms
451
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 151ms
449
+ ✓  node  test/pages/api/graphql.test.ts (10 tests) 31ms
450
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 40ms
451
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (5 tests) 153ms
452
452
  ✓  node  test/proxy.localization.test.ts (5 tests) 45ms
453
- ✓  node  test/server/index.test.ts (7 tests) 803ms
453
+ ✓  node  test/server/index.test.ts (7 tests) 1256ms
454
+ ✓ should return a valid merged GraphQL schema  306ms
455
+ ✓ should handle options and execute  689ms
454
456
  ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 48ms
455
- ✓  node  test/proxy.test.ts (4 tests) 25ms
456
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 39ms
457
- ✓  node  test/server/webops-api.test.ts (9 tests) 26ms
458
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 121ms
459
- ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 6ms
460
- ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
461
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (8 tests) 7ms
462
- ✓  node  test/server/content/service.test.ts (5 tests) 6ms
463
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 5ms
464
- ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 4ms
465
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 6ms
466
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 37ms
467
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 168ms
468
- ✓  node  test/pages/api/preview.test.ts (2 tests) 7ms
469
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
470
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 8ms
457
+ ✓  node  test/proxy.test.ts (4 tests) 51ms
458
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (8 tests) 100ms
459
+ ✓  node  test/server/webops-api.test.ts (9 tests) 22ms
460
+ ✓  node  test/sdk/account/refreshToken.test.ts (5 tests) 9ms
461
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 44ms
462
+ ✓  node  test/server/content/service.test.ts (5 tests) 5ms
463
+ ✓  node  test/server/cms/global.test.ts (3 tests) 5ms
464
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (8 tests) 8ms
465
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 4ms
466
+ ✓  node  test/sdk/analytics/hasEnabledRecommendationShelf.test.ts (6 tests) 5ms
467
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 5ms
468
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 38ms
469
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (6 tests) 129ms
470
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 9ms
471
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 4ms
472
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 7ms
471
473
  ✓  node  test/components/RecommendationShelf/vrn.test.ts (5 tests) 6ms
472
- ✓  node  test/server/cms/index.test.ts (2 tests) 15ms
473
- ✓  node  test/utils/retry.test.ts (5 tests) 12ms
474
- ✓  node  test/components/account/Layout.test.tsx (4 tests) 41ms
474
+ ✓  node  test/server/cms/index.test.ts (2 tests) 4ms
475
+ ✓  node  test/utils/retry.test.ts (5 tests) 14ms
476
+ ✓  node  test/components/account/Layout.test.tsx (4 tests) 39ms
475
477
  ✓  node  test/components/RecommendationShelf/useRecommendationUserId.test.ts (4 tests) 190ms
476
478
  ✓  node  test/utils/unlockResponse.test.ts (11 tests) 6ms
477
- ✓  node  test/components/RecommendationShelf/useRecommendations.test.ts (2 tests) 5ms
479
+ ✓  node  test/components/RecommendationShelf/useRecommendations.test.ts (2 tests) 4ms
478
480
  ✓  node  test/utils/isLocalHost.test.ts (7 tests) 5ms
479
- ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 4ms
480
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 54ms
481
- ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
482
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 37ms
483
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 14ms
484
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 25ms
481
+ ✓  node  test/utils/userOrderStatus.test.ts (3 tests) 5ms
482
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 51ms
483
+ ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 8ms
484
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 44ms
485
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 11ms
486
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (2 tests) 24ms
485
487
 
486
488
   Test Files  71 passed (71)
487
489
   Tests  558 passed (558)
488
-  Start at  17:14:38
489
-  Duration  36.96s (transform 9.22s, setup 0ms, collect 28.92s, tests 11.09s, environment 50.83s, prepare 1.28s)
490
+  Start at  20:03:32
491
+  Duration  36.20s (transform 8.20s, setup 0ms, collect 28.89s, tests 11.53s, environment 47.49s, prepare 1.20s)
490
492
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0-dev.6](https://github.com/vtex/faststore/compare/v4.5.0-dev.5...v4.5.0-dev.6) (2026-07-28)
7
+
8
+ ### Bug Fixes
9
+
10
+ - prevent My Account 500s from empty session profile and missing CMS content ([#3417](https://github.com/vtex/faststore/issues/3417)) ([2c2a18f](https://github.com/vtex/faststore/commit/2c2a18fe8f4127404d6634933cce778a64169c08))
11
+
6
12
  # [4.5.0-dev.5](https://github.com/vtex/faststore/compare/v4.5.0-dev.4...v4.5.0-dev.5) (2026-07-27)
7
13
 
8
14
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.5.0-dev.5",
3
+ "version": "4.5.0-dev.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -71,11 +71,11 @@
71
71
  "style-loader": "^3.3.1",
72
72
  "swr": "^2.2.5",
73
73
  "use-sync-external-store": "^1.6.0",
74
- "@faststore/api": "4.5.0-dev.5",
75
- "@faststore/diagnostics": "4.5.0-dev.5",
76
- "@faststore/sdk": "4.5.0-dev.5",
77
- "@faststore/lighthouse": "4.5.0-dev.5",
78
- "@faststore/ui": "4.5.0-dev.5"
74
+ "@faststore/diagnostics": "4.5.0-dev.6",
75
+ "@faststore/api": "4.5.0-dev.6",
76
+ "@faststore/lighthouse": "4.5.0-dev.6",
77
+ "@faststore/sdk": "4.5.0-dev.6",
78
+ "@faststore/ui": "4.5.0-dev.6"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@cypress/code-coverage": "^3.12.1",
@@ -114,7 +114,7 @@ const getServerSidePropsBase: GetServerSideProps<
114
114
  return {
115
115
  props: {
116
116
  globalSections: globalSectionsResult,
117
- accountName: account.data.accountProfile.name,
117
+ accountName: account.data?.accountProfile?.name ?? '',
118
118
  isRepresentative,
119
119
  },
120
120
  }
@@ -147,9 +147,9 @@ const getServerSidePropsBase: GetServerSideProps<
147
147
 
148
148
  return {
149
149
  props: {
150
- page,
150
+ page: page ?? ({ sections: [], settings: {} } as PageContentType),
151
151
  globalSections: globalSectionsResult,
152
- accountName: account.data.accountProfile.name,
152
+ accountName: account.data?.accountProfile?.name ?? '',
153
153
  },
154
154
  }
155
155
  }
@@ -16,22 +16,23 @@ export async function fetchMyAccountPageContent(
16
16
  context: FetchMyAccountPageContentContext,
17
17
  pagePath: string
18
18
  ) {
19
- const pageContent = await contentService
20
- .getSingleContent<PageContentType>({
21
- contentType,
22
- previewData: context.previewData,
23
- locale: context.locale,
24
- })
25
- .catch((err) => {
26
- console.warn('[MyAccount CMS fallback]', {
19
+ const pageContent =
20
+ (await contentService
21
+ .getSingleContent<PageContentType>({
27
22
  contentType,
23
+ previewData: context.previewData,
28
24
  locale: context.locale,
29
- fallbackReason: err instanceof Error ? err.message : String(err),
30
- page: pagePath,
31
25
  })
26
+ .catch((err) => {
27
+ console.warn('[MyAccount CMS fallback]', {
28
+ contentType,
29
+ locale: context.locale,
30
+ fallbackReason: err instanceof Error ? err.message : String(err),
31
+ page: pagePath,
32
+ })
32
33
 
33
- return { sections: [], settings: {} } as PageContentType
34
- })
34
+ return { sections: [], settings: {} } as PageContentType
35
+ })) ?? ({ sections: [], settings: {} } as PageContentType)
35
36
 
36
37
  const sections = withDefaultMyAccountSections(
37
38
  contentType,