0

Firefox WebDriver Fails with "Cyclic object value" Error When Using jasmine-browser-runner with Ext.js 3.2.1

Problem Summary

jasmine-browser-runner works perfectly with Chrome but fails with Firefox due to a "Cyclic object value" error in Firefox's Marionette WebDriver protocol when trying to serialize JavaScript objects that contain circular references created by **Ext.js 3.2.1.

Environment

  • jasmine-browser-runner: Latest version
  • Firefox: Any version (tested with multiple versions)
  • Chrome: Works perfectly (same test, same code)
  • selenium-webdriver: Standard dependency of jasmine-browser-runner
  • Ext.js: Version 3.2.1 (creates Function.prototype extensions with circular references)
  • OS: Linux (but affects all platforms)

Minimal Reproduction

  1. Create a simple test that includes Ext.js 3.2.1:
// jasmine-config.js module.exports = { srcFiles: [ 'path/to/ext-js-3.2.1/ext-base-debug.js', // Contains problematic Function.prototype.createInterceptor 'path/to/ext-js-3.2.1/ext-all-debug.js' // Uses createInterceptor extensively ], specFiles: [ 'test/simple.spec.js' ] }; 
// test/simple.spec.js describe('Simple Test with Ext.js', function() { it('should pass', function() { expect(true).toBe(true); }); }); 
  1. Run with Chrome (WORKS):
npx jasmine-browser-runner runSpecs --config=jasmine-config.js --browser=chrome # SUCCESS: Tests pass without issues 
  1. Run with Firefox (FAILS):
npx jasmine-browser-runner runSpecs --config=jasmine-config.js --browser=firefox # FAILURE: JavascriptError: Cyclic object value 

Exact Error

JavascriptError: Cyclic object value: function(fcn, scope){ var method = this; return !Ext.isFunction(fcn) ? this : function() { var me = this, args = arguments; fcn.target = me; // <- Circular reference created by Ext.js 3.2.1 fcn.method = method; // <- Circular reference created by Ext.js 3.2.1 return (fcn.apply(scope || me || window, args) !== false) ? method.apply(me || window, args) : null; }; } at Object.throwDecodedError (selenium-webdriver/lib/error.js:523:15) at parseHttpResponse (selenium-webdriver/lib/http.js:524:13) RemoteStacktrace: cloneObject@chrome://remote/content/marionette/json.sys.mjs:46:11 cloneJSON@chrome://remote/content/marionette/json.sys.mjs:207:12 json.clone@chrome://remote/content/marionette/json.sys.mjs:212:22 receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.sys.mjs:289:19 request@http://localhost:8890/__src__/path/to/ext-js/ext-and-extensions-debug.js:84625:22 

Root Cause Analysis

  1. Ext.js 3.2. extends Function.prototype with methods like createInterceptor that create circular references:

    // From ext-base-debug.js line ~863 Function.prototype.createInterceptor = function(fcn, scope){ var method = this; // Creates circular reference return function() { fcn.target = me; // Assigns circular reference fcn.method = method; // Assigns circular reference }; }; 
  2. Chrome DevTools Protocol: Handles these circular references gracefully during object serialization

  3. Firefox Marionette Protocol: Uses strict JSON serialization that fails immediately on circular references

  4. The Issue: When jasmine-browser-runner tries to extract test results, Firefox's Marionette cannot serialize the JavaScript execution context that contains these Ext.js circular references

Impact

This makes jasmine-browser-runner completely unusable with Firefox for any project that includes Ext.js 3.2.1 or similar libraries that extend Function.prototype with circular reference patterns.

Affected Libraries:

  • Ext.js 3.x (specifically 3.2.1 confirmed)
  • Any legacy JavaScript framework that extends Function.prototype
  • Libraries using createInterceptor, createSequence, createDelegate patterns

Expected Behavior

Firefox should behave the same as Chrome - tests should run successfully regardless of Ext.js 3.2.1's circular references in the JavaScript execution context.

Actual Behavior

Firefox fails immediately with "Cyclic object value" error during WebDriver communication, making jasmine-browser-runner unusable with Ext.js 3.2.1.


This issue specifically affects anyone trying to use jasmine-browser-runner for cross-browser testing with legacy Ext.js 3.2.1 applications. The same tests that work perfectly in Chrome are completely blocked in Firefox due to Ext.js 3.2.1's Function.prototype extensions creating circular references that Firefox's Marionette protocol cannot handle.

Questions

  1. For jasmine-browser-runner: Is there a way to configure the result extraction to avoid serializing problematic objects created by Ext.js 3.2.1?

  2. For Firefox/Marionette: Should Marionette be more lenient with circular references like Chrome's DevTools Protocol, especially for legacy JavaScript frameworks like Ext.js?

  3. Workaround: Is there a way to make jasmine-browser-runner use a different protocol for Firefox, or configure Marionette to handle Ext.js 3.2.1's circular references?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.