File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 < meta name ="description " content ="RayLens - Browser-first analytical application built on RayforceDB " />
88 < title > RayLens</ title >
99 <!-- Enable SharedArrayBuffer on GitHub Pages via service worker -->
10- < script src ="coi-serviceworker.js "> </ script >
10+ < script src ="./ coi-serviceworker.js "> </ script >
1111 <!-- Preload fonts -->
1212 < link rel ="preconnect " href ="https://fonts.googleapis.com " />
1313 < link rel ="preconnect " href ="https://fonts.gstatic.com " crossorigin />
Original file line number Diff line number Diff line change @@ -92,9 +92,16 @@ async function handleInit(): Promise<void> {
9292 try {
9393 console . log ( '[Worker] Initializing Rayforce WASM...' ) ;
9494
95- const jsUrl = new URL ( '/rayforce/rayforce.js' , self . location . origin ) . href ;
96- const sdkUrl = new URL ( '/rayforce/rayforce.sdk.js' , self . location . origin ) . href ;
97- const wasmUrl = new URL ( '/rayforce/rayforce.wasm' , self . location . origin ) . href ;
95+ // Get base path from worker location (handles GitHub Pages subpath)
96+ const workerUrl = new URL ( self . location . href ) ;
97+ const basePath = workerUrl . pathname . replace ( / \/ a s s e t s \/ .* $ / , '' ) ;
98+
99+ const jsUrl = `${ workerUrl . origin } ${ basePath } /rayforce/rayforce.js` ;
100+ const sdkUrl = `${ workerUrl . origin } ${ basePath } /rayforce/rayforce.sdk.js` ;
101+ const wasmUrl = `${ workerUrl . origin } ${ basePath } /rayforce/rayforce.wasm` ;
102+
103+ console . log ( '[Worker] Base path:' , basePath ) ;
104+ console . log ( '[Worker] WASM URL:' , wasmUrl ) ;
98105
99106 // Fetch and patch the WASM loader
100107 const response = await fetch ( jsUrl ) ;
You can’t perform that action at this time.
0 commit comments