Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eskhool opened this issue May 24, 2014 · 22 comments

Comments

@eskhool
Copy link

eskhool commented May 24, 2014

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

@skariel
Copy link
Owner

skariel commented May 24, 2014

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
Copy link
Author

eskhool commented May 25, 2014

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
Copy link
Author

eskhool commented May 25, 2014

It seems that this.app is undefined in all browsers

@skariel
Copy link
Owner

skariel commented May 25, 2014

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

Thanks!

@eskhool
Copy link
Author

eskhool commented May 25, 2014

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

@skariel
Copy link
Owner

skariel commented May 25, 2014

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
Copy link
Author

eskhool commented May 25, 2014

todomvc html

@eskhool
Copy link
Author

eskhool commented May 25, 2014

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

@skariel
Copy link
Owner

skariel commented May 25, 2014

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
Copy link
Author

eskhool commented May 25, 2014

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
Copy link
Owner

skariel commented May 25, 2014

Still can't d/l... anyway just send me the html file without compression, by mail to [email protected]

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

@eskhool
Copy link
Author

eskhool commented May 25, 2014

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

@skariel
Copy link
Owner

skariel commented May 25, 2014

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 skariel closed this as completed May 25, 2014
@skariel
Copy link
Owner

skariel commented May 25, 2014

closed by mistake...

@skariel skariel reopened this May 25, 2014
@eskhool
Copy link
Author

eskhool commented May 25, 2014

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
Copy link
Owner

skariel commented May 25, 2014

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

@eskhool
Copy link
Author

eskhool commented May 26, 2014

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
Copy link
Owner

skariel commented May 26, 2014

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
Copy link
Owner

skariel commented May 26, 2014

related: PyCQA/pep8-naming#10

@skariel
Copy link
Owner

skariel commented May 26, 2014

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
Copy link
Author

eskhool commented May 26, 2014

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
Copy link
Owner

skariel commented May 27, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants