Pajama-JS icon indicating copy to clipboard operation
Pajama-JS copied to clipboard

toMarkup error

Open jackcannon opened this issue 11 years ago • 1 comments

Using browser.pajama.js, and trying to toMarkup an element gives back an error:

"TypeError: Cannot call method 'toMarkup' of undefined at PjsElement.self.toMarkup (http://192.168.56.101:5000/vendor/pajama/browser.pajama.js:332:51) at PjsElement.self.toMarkup (http://192.168.56.101:5000/vendor/pajama/browser.pajama.js:332:51) at :2:6 at Object.InjectedScript._evaluateOn (:581:39) at Object.InjectedScript._evaluateAndWrap (:540:52) at Object.InjectedScript.evaluate (:459:21)"

This happens when running the example at http://www.pajamajs.com/serverside.html It appears to be trying to call "Hello World"._view.toMarkup() on line 331. Obviously, "Hello World" doesn't have a _view property.

jackcannon avatar Nov 29 '13 03:11 jackcannon

I found some time to take a look at your issue, and I can't replicate it. The code on the website is also in this repo ready-to-go: https://github.com/theninj4/Pajama-JS/tree/master/demo/serverside

From the root of the project you can: node demo/serverside/server.js and browse to http://localhost:8080/ to see the Hello World.

Looking at your stack trace, it looks like you might have mixed up the browser.pajama.js and node.pajama.js libraries ;)

hxoliverrumbelow avatar Jan 18 '14 19:01 hxoliverrumbelow