Skip to content

Commit 6aad16e

Browse files
committed
Loads runtime config synchronously on Azure
Switches to synchronous loading so runtime settings are available before app initialization, preventing startup race conditions. Keeps cache-busting timestamp and removes the error warning.
1 parent e866ba5 commit 6aad16e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

index.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
<title>TrackMan Script Editor</title>
77
<link rel="icon" type="image/x-icon" href="https://golf-portal-dev.trackmangolfdev.com/favicon.ico" />
88
<link rel="stylesheet" href="/src/index.css" />
9-
<!-- Runtime configuration for Azure App Service -->
9+
<!-- Runtime configuration for Azure App Service (loaded synchronously) -->
1010
<script>
11-
// Load runtime config with cache-busting timestamp (only in production)
11+
// For Azure deployments: synchronously load runtime config before app starts
1212
if (window.location.hostname !== 'localhost' && window.location.hostname !== '127.0.0.1') {
13-
const script = document.createElement('script');
14-
script.src = '/runtime-config.js?v=' + Date.now();
15-
script.onerror = function() {
16-
console.warn('Runtime config not available - using build-time environment variables');
17-
};
18-
document.head.appendChild(script);
13+
document.write('<script src="/runtime-config.js?v=' + Date.now() + '"><\/script>');
1914
}
2015
</script>
2116
</head>

0 commit comments

Comments
 (0)