Repository navigation
Description
Kanopy videos don't load in the LMS app (Via breaks Kanopy's new JavaScript)
The issue
Kanopy video pages that previously displayed in the LMS app now show only Kanopy's logo and a loading spinner that never goes away. The same page loads normally outside Hypothesis. Note that there's no expectations to load an annotatble transcript; Kanopy doesn't have a public API. User's just show movies and have students create page notes.
Claude notes:
Observed (from three HAR captures — two through the LMS app, one loading Kanopy directly):
- Kanopy has moved to a new frontend ("KUI"; response header
kanopy-system: kui). The HTML page is an empty shell; the whole app is one ES module loaded via<script type="module" src=".../kui-assets/client-B_OO2n2q.js">. Removing thefrontend=kuiURL parameter makes no difference — Kanopy serves KUI either way. - Through Via, the bundle returns 200, but viahtml wraps it in its standard classic-script wombat wrapper (
{ let window = ...; let arguments; { ...bundle... } }). - That wrapped file is not valid as a module. Checked with
node --check, the file Via served fails twice over: firstSyntaxError: Unexpected eval or arguments in strict mode(the wrapper'slet arguments;— modules are always strict), thenSyntaxError: Unexpected token 'export'(the bundle's finalexport{...}ends up inside the wrapper's block). The same file with the wrapper stripped parses cleanly. - Result: the app never runs. No Kanopy API calls and no lazy-loaded chunks appear in the Via HARs. Loaded directly, the same bundle loads ~40 chunks and calls
/kapi/...endpoints within a second. - Kanopy is behind Cloudflare and serves its bot-detection script, but that check returns 200 through Via. Not a bot/IP block (unlike the PMC case).
Interpreted (not directly confirmed):
- The error is the same one reported for the Canvas Studio public-embed workaround in Canvas Studio videos not working correctly when embedded in Canvas Pages and shown in the LMS app #1748 (
Unexpected eval or arguments in strict moderight after Studio's main bundle loads). That error only fires in strict-mode code, so Studio's player is likely also an ES module hitting the same rewrite problem. Worth confirming in STUDIO2.har whether Studio's bundle is loaded withtype="module". - pywb has separate handling for module scripts, but appears to detect them by looking for
import/exportat the start of a line. Kanopy's minified bundle hasexport{mid-line, which may be why it was treated as a classic script. Not verified against the viahtml/pywb version we run.
What's needed
Sites that ship their main app as an ES module (Kanopy now; likely Canvas Studio's player) need to load and run through Via instead of failing at parse time.
Possible solution
Make viahtml rewrite ES-module scripts in a module-safe way (or leave them unwrapped), and make sure scripts loaded with type="module" are recognized as modules even when minified.
Claude notes:
- The lazily loaded chunks (about 120
import()calls, plusimport.meta.urlusage) are modules too, so a fix has to cover those as well as the entry bundle. - Not yet tested: whether Kanopy works end-to-end once the app boots. Students would still need to sign in through their institution and play video inside the proxied frame, which is where Canvas Studio videos not working correctly when embedded in Canvas Pages and shown in the LMS app #1748 and Zoom videos not working correctly when embedded in Canvas Pages and shown in the LMS app #1749 run into session/SSO problems. Worth confirming before assuming this fix alone restores Kanopy.
Related: #1748 (Canvas Studio; the public-embed SyntaxError), #1749
HARs: [location]
Activity
mkdir-washington-edu commentedon Oct 7, 2026
Ticket: https://app.hubspot.com/contacts/6291320/record/0-5/49257350569
karenrasmussen commentedon Nov 16, 2026
hypothesis/viahtml#892