Skip to content


pyjsbuild --dynamic=".*" fails for dynamic imports involving a classname (from X import Y?) #331

pyjsorg opened this Issue · 3 comments

1 participant


What steps will reproduce the problem?
1) create a folder, "static"
2) create file, "", with this content:

from pyjamas.ui.RootPanel import RootPanel

if name == 'main':

3) build app into static folder, w/dynamic module loading:

>>> pyjsbuild --dynamic=".*" -mdo static

4) serve the static folder:

>>> cd static; python -m SimpleHTTPServer

5) try to load the page, "http://localhost:8000"

What is the expected output? What do you see instead?

blank page to load, no import errors

index ImportError: No module named pyjamas.ui.RootPanel.RootPanel,
pyjamas.ui.RootPanel.RootPanel in context null

Please use labels and text to provide additional information.

the code in dynamic.js/py seems to be trying to pull the file
"lib/pyjamas.ui.RootPanel.RootPanel" instead of the actual module file at
"lib/pyjamas.ui.RootPanel". if you rebuild the app without --dynamic
everything works as expected.

Original issue: (March 31, 2010 03:07:24)


From on March 31, 2010 18:33:12:
er as an attachment...


From on March 31, 2010 23:26:16:
i can confirm dynamic load works for:

import pyjamas.ui.RootPanel
import pyjamas.ui.RootPanel as rp

then either use fully qualified name or rp. does not work for:

from pyjamas.ui.RootPanel import RootPanel

i am working on import to fix this... seems that the JS import
mechanism never tries to dynamically load the parent first.


From on April 01, 2010 01:51:49:
here is a preliminary patch for dynamically loading the parent; i'm not sure what all
is going on here:

what is...
JS("$pyjs.track.module = save_track_module;")

when do i need to (seems not consistent)...
sys.modules[parentName] = module

patch allows the simple case to run, but fails on my actual app with:

index ReferenceError: jsonrpc is not defined

(which coincidentally is the last module to be loaded... this isn't the most
informative post, im still trying to get a working pyjamas-desktop (hulahop won't
compile on archlinux...) ill try to get a stack trace from pyjs (im enabling debug,
but the console is empty other than XHR requests? [Chrome])

feedback appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.