Skip to content


Subversion checkout URL

You can clone with
Download ZIP


TypeError: 'undefined' is not a function #209

NiklasHansen opened this Issue · 7 comments

4 participants



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

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).


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


I have the same problem with Safari 5.1.7 on Windows.

Here's a link to reproduce:


Windows 7 Professional SP1 64-bit.
Safari 5.1.7

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

@luanmuniz luanmuniz referenced this issue

Broken tests #210


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';, function (status) {
  //Page is loaded!

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


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.

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.