Skip to content

Commit a83abb3

Browse files
committed
Add console warn
1 parent f2eb4d0 commit a83abb3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/commerce-sdk-react/src/components/StorefrontPreview/storefront-preview.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ export const StorefrontPreview = ({
7676

7777
useEffect(() => {
7878
if (enabled && isHostTrusted) {
79+
if (process.env.NODE_ENV !== 'production' && !getBasePath) {
80+
console.warn(
81+
'[StorefrontPreview] No getBasePath prop provided. ' +
82+
'If your app uses a base path for router routes (showBasePath is true in url config), ' +
83+
'pass getBasePath to avoid base path duplication during navigation.'
84+
)
85+
}
7986
window.STOREFRONT_PREVIEW = {
8087
...window.STOREFRONT_PREVIEW,
8188
getToken,

0 commit comments

Comments
 (0)