OvidijusParsiunas/myvision

myvision can not deploy to server like flask.

584251395 opened this issue · 3 comments

appBundle.2404691effe4ecfa2988.js:2 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')

Hi @584251395, can you provide me with some context around what you are trying to achieve and what tools you are using, thanks!

i'm try to build a python web project with flask, and import the javascript file appBunde , it shows above errors in the web browser, I have used published file of myvision.which still not work.

Based on your comments I am assuming that you are attempting to do server side rendering via flask. A common problem with server side rendering is the fact that the window object is not recognised by the server (flask) and can only be understood by the client's browser, hence because MyVision has been initially designed to be a website rendered by the browser, the window object must be accessible.

I am not quite sure if it is possible to achieve your objective with server side rendering and would instead recommend using a CDN approach. Furthermore, the issue that you are facing does not look like it stems from the MyVision code itself but instead from the platform that you are using. Whilst I am more than happy for the app to be reused on other platforms, the amount of assistance I can provide on them is unfortunately limited.

I am going to close this issue, however if there are any details that anyone can add to assist with this - you are more than welcome to add them in the comments below. Thankyou!