Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

TypeError: 'undefined' is not a function #209

Closed
NiklasHansen opened this Issue · 7 comments

4 participants

@NiklasHansen

Hi,

When using list.js in conjunction with Safari or PhantomJS, I experience the following issue:

list.js:433
TypeError: 'undefined' is not a function (evaluating 'el[bind](prefix + type, fn, capture || false)')

Both Safari and PhantomJS use JavaScriptCore for javascript engine. I don't experience any problems in Chrome (with the V8 engine).

@javve
Owner

Which Safari version and OS?
Can I see some code?

I know that there are some problems with PhantomJS that I haven't had time to investigate yet :S

@mbp

I have the same problem with Safari 5.1.7 on Windows.

Here's a link to reproduce: https://rawgithub.com/mbp/059a0c438463fce97d41/raw/clicktest.html

@NiklasHansen

Windows 7 Professional SP1 64-bit.
Safari 5.1.7

and @mbp just provided some code to look at :-)

@luanmuniz luanmuniz referenced this issue
Closed

Broken tests #210

@woto

Hi, i found the difference between Chrome and PhantomJS.

module.exports = function toArray(collection) {
  ...
  //console.log(typeof collection === 'function');
  // in phantomjs it returns true, in chrome not.
  if (typeof collection === 'function') return [collection]

Simple replacing to

  if (typeof collection === 'function') return collection

fix the problem, don't know is this right for other browsers.

Tested with this simple script. I hope it's will be usefull

console.log('Loading a web page');

var page = require('webpage').create();

var system = require('system');

page.onConsoleMessage = function(msg) {
    system.stderr.writeLine('console: ' + msg);
};

var url = 'http://localhost:3002';
page.open(url, function (status) {
  //Page is loaded!
  phantom.exit();
});
@mbp

I can confirm this fix works. Is it possible to get into list.js master, @javve?

@javve
Owner

Thanks a lot for the fix suggestion and the confirmation!
I'll look into it asap.

@mbp mbp referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@javve
Owner

This should now be fixed as of version 1.1.1 :sunny:

@javve javve closed this
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.