Skip to content

TypeError: 'undefined' is not a function #209

NiklasHansen opened this Issue Feb 10, 2014 · 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).

javve commented Feb 10, 2014

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 commented Feb 10, 2014

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 Feb 15, 2014

Broken tests #210

woto commented Mar 10, 2014

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!
mbp commented Mar 14, 2014

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

javve commented Mar 14, 2014

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

javve commented Mar 21, 2014

This should now be fixed as of version 1.1.1 ☀️

@javve javve closed this Mar 21, 2014
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.