canvas-lms icon indicating copy to clipboard operation
canvas-lms copied to clipboard

When using the rich text editor to search for and display some embedded media TypeError occurs

Open jonespm opened this issue 1 year ago • 2 comments

We've noticed in the last few weeks that when using the Rich Text Editor button to browse for and search for some external tool media this javascript error occurs in the console. It also occurs when trying to display and play some content in an iframe that's linked using this method. I don't know what specifics but it seems to be more with video content like Kaltura.

VM4169 main-e-38975df019.js:30685 Uncaught TypeError: Cannot read properties of undefined (reading 'instui_nav')
    at VM4169 main-e-38975df019.js:30685:366
    at VM4169 main-e-38975df019.js:31225:30
    at VM4169 main-e-38975df019.js:31225:34

This seems like it might be causing some issues for some users. It looks like in the iframe the window.ENV isn't always available. This should probably be handled in an exception or else the ENV should be available.

I believe this recent change is where this error is coming from.

Thanks!

https://github.com/instructure/canvas-lms/blame/634fb0023076467fcab6482036b54b6f8c2a18f7/ui/boot/initializers/router.tsx#L34

jonespm avatar Nov 08 '23 15:11 jonespm

I wonder here if lack of access to localStorage (in localStorage.instui_nav_dev, due to iframe policy) is the issue.

aaronshaf avatar Nov 09 '23 17:11 aaronshaf

Looking at this again on Monday. Ultimately I think we need to reduce our use of the "bare" layout, which loads too much JS (including in iframe contexts?).

aaronshaf avatar Nov 09 '23 17:11 aaronshaf

I'm not longer seeing this issue so must have been incorporated, going to close.

jonespm avatar Apr 10 '24 14:04 jonespm