defunctzombie/zuul

Zuul 3.8.0 Phantom error

dey-dey opened this issue · 2 comments

install zuul@2.x.x fixed this.

./node_modules/zuul/bin/zuul --phantom -- test/unit/index.js

.zuul.yml

ui: tape
browsers:
  - name: chrome
    version: latest
  - name: safari
    version: latest
  - name: firefox
    version: latest
browserify:
  - transform: babelify
  - debug: true

babelify version: 6.4.0
react: 0.14

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: TypeError: Function.prototype.bind called on incompatible function mixSpecIntoComponent(Constructor, spec) {
  if (!spec) {
    return;
  }

  !(typeof spec !== 'function') ? "local" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
  !!ReactElement.isValidElement(spec) ? "local" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;

  var proto = Constructor.prototype;

  // By handling mixins before any other properties, we ensure the same
  // chaining order is applied to methods with DEFINE_MANY policy, whether
  // mixins are listed before or after these methods in the spec.
  if (spec.hasOwnProperty(MIXINS_KEY)) {
    RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
  }

  for (var name in spec) {
    if (!spec.hasOwnProperty(name)) {
      continue;
    }

    if (name === MIXINS_KEY) {
      // We have already handled mixins in a special case above.
      continue;
    }

    var property = spec[name];
    validateMethodOverride(proto, name);

    if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
      RESERVED_SPEC_KEYS[name](Constructor, property);
    } else {
      // Setup methods on prototype:
      // The following member methods should not be automatically bound:
      // 1. Expected ReactClass methods (in the "interface").
      // 2. Overridden methods (that were mixed in).
      var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
      var isAlreadyDefined = proto.hasOwnProperty(name);
      var isFunction = typeof property === 'function';
      var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;

      if (shouldAutoBind) {
        if (!proto.__reactAutoBindMap) {
          proto.__reactAutoBindMap = {};
        }
        proto.__reactAutoBindMap[name] = property;
        proto[name] = property;
      } else {
        if (isAlreadyDefined) {
          var specPolicy = ReactClassInterface[name];

          // These cases should already be caught by validateMethodOverride.
          !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "local" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;

          // For methods which are defined more than once, call the existing
          // methods before calling the new property, merging if appropriate.
          if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
            proto[name] = createMergedResultFunction(proto[name], property);
          } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
            proto[name] = createChainedFunction(proto[name], property);
          }
        } else {
          proto[name] = property;
          if ("local" !== 'production') {
            // Add verbose displayName to the function, which helps when looking
            // at profiling tools.
            if (typeof property === 'function' && spec.displayName) {
              proto[name].displayName = spec.displayName + '_' + name;
            }
          }
        }
      }
    }
  }
}
    at Stream.<anonymous> (/Users/amadeus/projects/apps/services/GraphTools/src/main/resources/assets/node_modules/zuul/lib/PhantomBrowser.js:97:36)
    at Stream.emit (events.js:107:17)
    at drain (/Users/amadeus/projects/apps/services/GraphTools/src/main/resources/assets/node_modules/zuul/node_modules/char-split/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/Users/amadeus/projects/apps/services/GraphTools/src/main/resources/assets/node_modules/zuul/node_modules/char-split/node_modules/through/index.js:45:5)
    at Stream.<anonymous> (/Users/amadeus/projects/apps/services/GraphTools/src/main/resources/assets/node_modules/zuul/node_modules/char-split/index.js:16:26)
    at Stream.stream.write (/Users/amadeus/projects/apps/services/GraphTools/src/main/resources/assets/node_modules/zuul/node_modules/char-split/node_modules/through/index.js:26:11)
    at Socket.ondata (_stream_readable.js:540:20)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
vvo commented

Somehow you must be using a bind method that is no more compatible with phantomjs2, should be a phantomjs related issue rather than a zuul one.

Maybe try to run your script in phantomjs standalone and see how it goes

@vvo thanks! but the phantomjs version was 1.9.16 and older versions of zuul work with it.