Uncaught TypeError: Cannot call method 'replace' of undefined

684 views
Skip to first unread message

Smitha Milli

unread,
Nov 1, 2013, 2:03:53 AM11/1/13
to eas...@googlegroups.com
I include EasyXDM in a document on my localhost which loads an iframe also on localhost (although I don't believe this matters since I tried it with localhost and a different domain as well).  However when I instantiate easyXDM.Socket in the iframe I get the error "Uncaught TypeError: Cannot call method 'replace' of undefined."  The call stack is resolveUrl -> prepareTransportStack -> easyXDM.Socket.  I think the problem might be that easyXDM thinks the iframe is the host?  

This is line 569:
config.isHost = config.isHost || undef(query.xdm_p); 

config.isHost is false but undef(query.xdm_p); returns true so config.isHost is set to true.  Because config.isHost is set to true the code goes to the else block on 586 which then calls resolveURL, although no URL was passed in originally, and it returns an error.

Have no idea how to approach this.. any ideas??
Thanks!

Christopher Owen

unread,
Nov 29, 2013, 5:19:27 AM11/29/13
to eas...@googlegroups.com
Having exactly the same issues, and also no idea how to resolve

Smitha Milli

unread,
Nov 29, 2013, 11:38:43 PM11/29/13
to eas...@googlegroups.com
Figured it out, totally silly error on my part!  What happened is here in case anyone else is having the same problem -> http://smithamilli.com/bizarre-easyxdm-error/

Øyvind Sean Kinsey

unread,
Dec 2, 2013, 1:19:07 PM12/2/13
to easyxdm
This issue generally comes from trying to load the consumer page directly, instead of having easyXDM load it.
Could you check if this is the case? Typically you would see two requests to the page and an extra iframe in the document.



Øyvind Sean Kinsey
San Francisco, CA


--
You received this message because you are subscribed to the Google Groups "easyxdm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to easyxdm+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages