OctoPNP icon indicating copy to clipboard operation
OctoPNP copied to clipboard

Javascript error during to reload Octoprint

Open xpix opened this issue 7 years ago • 4 comments

Hello,

i found a solutiuon to install OctoPNP on an RPI3. But if i reload my Octoprint then i run in this javascript error:

Uncaught TypeError: Cannot read property 'setAttribute' of null
    at new OctoPNPViewModel (packed_plugins.js?0afb2d09:584)
    at _createViewModelInstance (packed_core.js?f7d19c53:13069)
    at HTMLDocument.<anonymous> (packed_core.js?f7d19c53:13147)
    at fire (packed_libs.js?d8971830:3187)
    at Object.fireWith [as resolveWith] (packed_libs.js?d8971830:3317)
    at Function.ready (packed_libs.js?d8971830:3536)
    at HTMLDocument.completed (packed_libs.js?d8971830:3552)
OctoPNPViewModel @ packed_plugins.js?0afb2d09:584
_createViewModelInstance @ packed_core.js?f7d19c53:13069
(anonymous) @ packed_core.js?f7d19c53:13147
fire @ packed_libs.js?d8971830:3187
fireWith @ packed_libs.js?d8971830:3317
ready @ packed_libs.js?d8971830:3536
completed @ packed_libs.js?d8971830:3552

I checked this part and here is the code wher the error is happend:

        //white placeholder images
        document.getElementById('headCameraImage').setAttribute( 'src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCQAfAmB4CgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAMSURBVAjXY/j//z8ABf4C/tzMWecAAAAASUVORK5CYII=');
        document.getElementById('bedCameraImage').setAttribute( 'src', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCQAfAmB4CgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAMSURBVAjXY/j//z8ABf4C/tzMWecAAAAASUVORK5CYII=');

Version: OctoPrint 1.3.6.dev37+gb161a1f (maintenance branch)

xpix avatar May 16 '18 12:05 xpix

Hi, ok i found a solution for this problem above, let octopnp run on my windows pc via docker and this image: https://github.com/OctoPrint/docker

After that, install plugin over webinterface ... thats easy.

xpix avatar May 17 '18 11:05 xpix

Thanks for the investigation, do you have any clue why it runs on the Docker image?

platsch avatar May 17 '18 11:05 platsch

@platsch I checked the logs, but can't find any hints. But the first time i try to install this on my RPI on raspbian, you know somebody run in python.opencv package problem (not exists in raspbian) ... maybe you can try to install ur plugin under raspbian?

Here you can try to start an own docker image with raspbian: https://hub.docker.com/r/saraqian/raspbian_octopi/

xpix avatar May 17 '18 12:05 xpix

Yes, I should probably do so. I'm currently only using Odroids due to their better CPU and don't have a current RasPI at hand. The code should be overhauled anyway since some of the OctoPrint plugin interfaces have changed and we are still using the deprecated APIs.

platsch avatar May 18 '18 09:05 platsch