From d21ba0b6d2117a9d44e0a1d30fe5c0ebc543a671 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Tue, 26 Aug 2025 16:20:43 +0200
Subject: [PATCH] [chore] Fix CRM demo cannot load MSW when deployed on a sub
URL
---
examples/crm/src/index.tsx | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/examples/crm/src/index.tsx b/examples/crm/src/index.tsx
index 076c49c7740..a685addf86a 100644
--- a/examples/crm/src/index.tsx
+++ b/examples/crm/src/index.tsx
@@ -7,13 +7,19 @@ import { worker } from './providers/fakerest/fakeServer';
const container = document.getElementById('root');
const root = createRoot(container!);
-worker.start({ onUnhandledRequest: 'bypass', quiet: true }).then(() => {
- root.render(
-
-
-
- );
-});
+worker
+ .start({
+ onUnhandledRequest: 'bypass',
+ quiet: true,
+ serviceWorker: { url: './mockServiceWorker.js' },
+ })
+ .then(() => {
+ root.render(
+
+
+
+ );
+ });
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))