Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

jsbin examples fail to run #35

Closed
jzaefferer opened this issue Jan 5, 2011 · 9 comments
Closed

jsbin examples fail to run #35

jzaefferer opened this issue Jan 5, 2011 · 9 comments
Labels

Comments

@jzaefferer
Copy link

Trying to run tests from jsbin.com, which includes GA tracking code, fail with some unwieldy error output, e.g. http://jsbin.com/onomi4

Produces: https://gist.github.com/766080

The actual issue is overshadowed by the detailed console output, where it probably should just say [object Window] or something instead of printing hundreds of properties.

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

The original issue _gat is not defined seems to have been resolved.

However, visiting this site still causes at least one error:

{ stack: [Getter/Setter],
  arguments: [ 'style', undefined ],
  type: 'non_object_property_load',
  message: [Getter/Setter] } }

The cryptic 'non_object_property_load' means that code was treating either null or undefined as an object.

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

I believe the error I listed above occurs in http://jsbin.com/js/render/edit.js.

In a test that isolates ga.js (https://gist.github.com/844911), this error occurs instead:

{ stack: [Getter/Setter],
  arguments: [ 'javaEnabled', [Object] ],
  type: 'undefined_method',
  message: [Getter/Setter] } }

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

3a4cc2b addresses that one, now GA is erroring out with:

{ stack: [Getter/Setter],
  arguments: [ 'undefined' ],
  type: 'called_non_callable',
  message: [Getter/Setter] } }

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

This problem has something to do with document.write. If I replace

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/u/ga_debug.js' type='text/javascript'%3E%3C/script%3E"));
</script>

with

<script type="text/javascript" src="http://www.google-analytics.com/u/ga_debug.js"></script>

then pageTracker._trackPageview() executes without any errors.

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

I've narrowed down the exception. You can trigger it by calling just new Image(1, 1) rather than pageTracker._trackPageview() — after document.write-ing the ga.js include.

The test app is now: https://gist.github.com/845207

@boblail
Copy link
Contributor

boblail commented Feb 26, 2011

I pushed an implementation of Image just now; and Google Analytics appears to work without error.

Now, on to the problem with http://jsbin.com/js/render/edit.js ...

@boblail
Copy link
Contributor

boblail commented Mar 15, 2011

I think the problem is in jsdom. It looks like the following

var h = document.createElement('div');
h.innerHTML = '<div style=\"opacity:0.8\"></div>';
window.console.log(h.childNodes[0]);

yields undefined!

c.f. jsdom/jsdom#171

@ghost ghost assigned boblail Apr 12, 2011
@ghost
Copy link

ghost commented Jun 7, 2011

so has this been resolved?

@assaf
Copy link
Owner

assaf commented Aug 30, 2011

Fixed in JSDOM

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

No branches or pull requests

3 participants