Commit b5a3759f5cb for woocommerce
commit b5a3759f5cba62baf7e67582830a05ab4d335cf7
Author: Thomas Roberts <5656702+opr@users.noreply.github.com>
Date: Tue Mar 31 16:02:14 2026 +0100
Fix setup wizard TypeError on first site load (#63929)
* Fix setup wizard TypeError on first site load
Replace resolveSelect(coreStore).getEntityRecord('root', 'site') with
getSetting('siteTitle') to read the store name. The entity record approach
requires two async HTTP requests (OPTIONS + GET to /wp/v2/settings) whose
resolver chain can silently fail on a fresh install, causing an uncaught
TypeError: Cannot read properties of undefined (reading 'title').
The site title is already available synchronously via wcSettings, which
WooCommerce inlines in the page HTML.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin
* Simplify getStoreNameOption: remove unnecessary async wrapper
The getSetting() call is synchronous, so the async keyword is
unnecessary. Use an explicit Promise.resolve() to make the
synchronous nature clear while satisfying fromPromise's contract.
https://claude.ai/code/session_01TCF4VHUQcrvzFiyjSxSBwn
* Add inline comment explaining why fromPromise wraps a sync call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/63929-fix-setup-wizard-site-title-error b/plugins/woocommerce/changelog/63929-fix-setup-wizard-site-title-error
new file mode 100644
index 00000000000..17ff01407c4
--- /dev/null
+++ b/plugins/woocommerce/changelog/63929-fix-setup-wizard-site-title-error
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix setup wizard TypeError on first site load by reading site title from wcSettings instead of core-data entity record.
\ No newline at end of file
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
index fc610bd391a..39b7cf18b95 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
@@ -16,7 +16,7 @@ import {
import { useMachine, useSelector } from '@xstate5/react';
import { useMemo } from '@wordpress/element';
import { resolveSelect, dispatch } from '@wordpress/data';
-import { store as coreStore, Settings } from '@wordpress/core-data';
+import { store as coreStore } from '@wordpress/core-data';
import {
updateQueryString,
getQuery,
@@ -39,7 +39,7 @@ import {
} from '@woocommerce/data';
import { initializeExPlat } from '@woocommerce/explat';
import { CountryStateOption } from '@woocommerce/onboarding';
-import { getAdminLink } from '@woocommerce/settings';
+import { getAdminLink, getSetting } from '@woocommerce/settings';
import { recordEvent } from '@woocommerce/tracks';
/**
@@ -148,12 +148,12 @@ const handleTrackingOption = assign( {
} ) => event.output !== 'no',
} );
-const getStoreNameOption = fromPromise( async () =>
- resolveSelect( coreStore )
- // @ts-expect-error getEntityRecord is not typed correctly in coreStore
- .getEntityRecord( 'root', 'site' )
- .then( ( site ) => ( site as Settings ).title )
-);
+// Reading synchronously from wcSettings, but wrapped in fromPromise because
+// xstate's invoke with onDone/onError requires a promise-based actor.
+const getStoreNameOption = fromPromise( () => {
+ const value = getSetting( 'siteTitle', '' );
+ return Promise.resolve( typeof value === 'string' ? value : '' );
+} );
const handleStoreNameOption = assign( {
businessInfo: ( {