Forum Discussion
Storyline 360: JavaScript trigger timeout when fetching vehicle specs from regchecker API
Welcome! I've hit the async-in-Storyline wall before. A few patterns that have helped me:
1. Give fetch() a timeout — it has none by default, and inside an LMS wrapper a slow promise can hang far longer than in a plain browser tab. Wrap it with an AbortController (I use ~10 seconds) so you always get data or a clean failure you can act on.
2. Skip the Web Object for the API call. Run fetch() from a slide-level JS trigger instead — that sidesteps the iframe CORS wall entirely, and you can SetVar() the results directly when the promise resolves.
3. Design for the wait. Set your slide text to "Checking…" before the fetch, and handle both success and error paths in the same chain. Learners staring at blank fields assume the course is broken.
Also worth ruling out: if the endpoint is 200ms in a plain browser but 3000ms+ inside SCORM, check whether the LMS is routing requests through a different egress or proxy. I've chased latency that looked like a code problem and turned out to be infrastructure.
And cache plate lookups in a Storyline variable for the session — most learners revisit slides, and re-fetching the same plate each time adds up.