skariel / webalchemy

Modern web development with Python
MIT License
346 stars 21 forks source link

Uncaught TypeError: Cannot read property 'vm' of undefined (index):22 onkeyup #153

Open eskhool opened 10 years ago

eskhool commented 10 years ago

Getting this error from git master in the TODO MVC example. Is something obviously wrong since the online demo works fine.

skariel commented 10 years ago

I can't reproduce this, seems to work OK with my setup (both static generated HTML and served through a websocket). So, what do you see when you load the page, how and when do you get the error, are you able to create new todo items, delete them?

eskhool commented 10 years ago

The page loads fine but I am unable to create new to items and hence delete them , I see the following errors in the JS console (Chrome, Safari, Firefox latest on a Mac 10.9)

GET http://localhost:8080/learn.json 404 (Not Found) base.js Uncaught ReferenceError: None is not defined VM800 Uncaught TypeError: Cannot read property 'vm' of undefined (index)

In Firefox I get a this.app is undefined....

eskhool commented 10 years ago

It seems that this.app is undefined in all browsers

skariel commented 10 years ago

can you attach here the generated (static) HTML, I would like to compare with what I get wwith my setup

Thanks!

eskhool commented 10 years ago

Have attached the file as static.zip.png ...just remove the png (since github doesn't allow attaching anything but images) static zip

skariel commented 10 years ago

Hi, you attached the 'static' folder, but the generated HTML is just a file named todomvc.html placed in the examples/todomvc folder, just next to the 'static' folder which you attached

So currently I can't run your generated html app

eskhool commented 10 years ago

todomvc html

eskhool commented 10 years ago

Sorry I didn't read your request carefully...I've attached the file again as a png

skariel commented 10 years ago

File seems corrupted or empty, this time I cannot open it :(

Did you use a "clean" Webalchemy install? what version of Pythonium do you have?

eskhool commented 10 years ago

todomvc html

Attached the file again...please rename to todomvc.html from the png since you can only attach images to comments on github

I used a clean webalchemy installed using: pip -e git+https://github.com/skariel/webalchemy#egg=webalchemy pythonium is version 0.6.2

skariel commented 10 years ago

Still can't d/l... anyway just send me the html file without compression, by mail to skariel@gmail.com

Also - did you get the file by running free_app.py?

eskhool commented 10 years ago

I ran server.generate_static()...emailed the file to you

skariel commented 10 years ago

OK, your html contains a few "None" that should have been tranlated by Pythonium to "undefined" or "false", see attached diff with working app. These are just a few instances, I wonder how can this happen, are you using PythonJS or Pythonium? what version of Python? I've never seen this issue, could be an issue with Pythonium, maybe I can fix this, the only problem is that I can't duplicate this error... capture

skariel commented 10 years ago

closed by mistake...

eskhool commented 10 years ago

Well...I am on a Mac OS X Mavericks 10.9 machine ...is it possible that the platform difference is to blame? Python is 3.4.0...It is pythonium not python-js (I was only interested in that as an option but haven't ventured that far)...Pythonium is version 0.6.2 as I reported earlier... Have you tried with these combination of versions? Especially Python 3.4 since that may be curve balling pythonium

skariel commented 10 years ago

I never tried with Python 3.4, maybe this is the problem. I'll try it

eskhool commented 10 years ago

It is quite possibly the problem...which version of Python 3 is it tested with? I can try that too...but since 3.4 is the future its likely we have to make it work against that

skariel commented 10 years ago

Indeed, Python 3.4 seems to cause this problem, I just tried it. I'll try to fix Pythonium (or patch it through webalchemy) to fix this

skariel commented 10 years ago

related: https://github.com/flintwork/pep8-naming/issues/10

skariel commented 10 years ago

fixed in master! please check before I package this up.

Also I'm not closing the issue since there is one more fix due to Python 3.4, as the link above suggests

eskhool commented 10 years ago

It seems to work with this fix ...just diving into the webalchemy code to get a better handle on exactly how it works...are you at all concerned that Pythonium has been abandoned by the creator?

skariel commented 10 years ago

I'm not concerned, I'll take maintenance and development ownership. Also this functionality is mostly orthogonal to the rest of webalchemy, and not sol long ago it worked w/o any translation of Python to JS. Also PythonJS, if ported to Python3, can be plugged in easily