使用Iframe渲染Articulate内容时点击链接报错求助
Hey there, let's work through this issue you're hitting with your Articulate content embedded in an Iframe after enabling Tin Can API for LMS output. That TypeError is a clear sign the content is trying to access an object that doesn't exist—here's how to diagnose and fix it:
Common Causes & Fixes
Tin Can API isn't initialized in the Iframe context
When you publish Articulate content for LMS with Tin Can enabled, it expects the LMS to inject a globalTinCanobject (or similar) into the content's environment. If you're loading this content in a standalone Iframe (not hosted directly within your LMS), that critical object is missing, which triggers thegetmethod failure.- Debug this quickly: Right-click the Iframe, select "Inspect" to open dev tools, switch to the Iframe's console tab, and run
console.log(window.TinCan). If it returnsundefined, this is definitely the root cause.
- Debug this quickly: Right-click the Iframe, select "Inspect" to open dev tools, switch to the Iframe's console tab, and run
Cross-origin (CORS) restrictions blocking access
If your Iframe-hosted content lives on a different domain than the parent page (or your LMS), browser security policies might block the content from accessing the Tin Can API objects it needs.- Test this temporarily: Host the Articulate content and the parent page on the same domain. If the error disappears, you'll need to configure CORS headers on your LMS or content host to allow cross-origin access for xAPI calls.
Incorrect Articulate publish settings for your use case
If you're just trying to display the content in an Iframe (not track learning data via an LMS), you don't need the LMS + Tin Can API output at all.- Fix: Republish your Articulate content using the Web output option instead of LMS, and skip enabling Tin Can API. This builds a version that doesn't depend on LMS-specific xAPI infrastructure.
Missing LMS xAPI endpoint configuration
If you do need to track learning data via Tin Can, double-check that your LMS is properly set up to expose its xAPI endpoint to the Iframe content. Some LMS platforms require explicit setup to allow embedded content to send xAPI statements, including configuring the correct launch parameters for the content.
Error Reference
The exact error stack trace you shared:
app.min.js:40 Uncaught TypeError: Cannot read property 'get' of undefined at t.checkFlow (app.min.js:40) at Object.r.invokeGuardedCallback (app.min.js:8) at o (app.min.js:5) at Object.a [as executeDispatchesInOrder] (app.min.js:5) at d (app.min.js:5) at m (app.min.js:5) at Array.forEach () at n (app.min.js:10) at Object.processEventQueue (app.min.js:5) at n (app.min.js:8)

内容的提问来源于stack exchange,提问作者Samit Khulve

