Summary
In Safari the app loads, examples and projects work, but the simulation engine never becomes ready: the sidebar chip stays at Engine loading… NN% and the console shows
COOP/COEP Service Worker registered – "https://andeplane.github.io/atomify/"
Unhandled Promise Rejection: DataCloneError: The object can not be cloned.
Environment
Likely cause
index.html:52-54 configures coi-serviceworker with
window.coi = { coepCredentialless: () => true, ... };
so the service worker injects Cross-Origin-Embedder-Policy: credentialless for every browser. Safari does not implement credentialless (only require-corp; see caniuse, MDN), so the page never becomes cross-origin isolated, SharedArrayBuffer stays unavailable, and the pthreads/KOKKOS wasm build fails when the worker hands its shared memory to the thread pool — which surfaces as the DataCloneError above. The engine-loading chip then never resolves and there is no user-facing message.
Suggested fix
- Use
require-corp on Safari, e.g. coepCredentialless: () => !/^((?!chrome|android).)*safari/i.test(navigator.userAgent) Under require-corp, CORS fetches of example files keep working (raw.githubusercontent.com sends Access-Control-Allow-Origin: *), but no-cors subresources need a CORP header — the example thumbnails set as CSS background-image would need to be loaded as <img crossorigin="anonymous"> (CORS mode) to keep working on Safari.
- Independently of the fix: if
crossOriginIsolated is still false after the service-worker reload, show a clear "this browser can't run the engine" notice instead of an indefinite Engine loading….
Summary
In Safari the app loads, examples and projects work, but the simulation engine never becomes ready: the sidebar chip stays at Engine loading… NN% and the console shows
Environment
Likely cause
index.html:52-54configurescoi-serviceworkerwithso the service worker injects
Cross-Origin-Embedder-Policy: credentiallessfor every browser. Safari does not implementcredentialless(onlyrequire-corp; see caniuse, MDN), so the page never becomes cross-origin isolated,SharedArrayBufferstays unavailable, and the pthreads/KOKKOS wasm build fails when the worker hands its shared memory to the thread pool — which surfaces as theDataCloneErrorabove. The engine-loading chip then never resolves and there is no user-facing message.Suggested fix
require-corpon Safari, e.g.coepCredentialless: () => !/^((?!chrome|android).)*safari/i.test(navigator.userAgent)Underrequire-corp, CORS fetches of example files keep working (raw.githubusercontent.comsendsAccess-Control-Allow-Origin: *), but no-cors subresources need a CORP header — the example thumbnails set as CSSbackground-imagewould need to be loaded as<img crossorigin="anonymous">(CORS mode) to keep working on Safari.crossOriginIsolatedis stillfalseafter the service-worker reload, show a clear "this browser can't run the engine" notice instead of an indefinite Engine loading….