question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firefox tests are terminated along with JavaScript "too much recursion" error occurrence

See original GitHub issue

What is your Scenario?

I would like to run the test within our application on Firefox browser. Test is terminated along with error in console (see section “Current behavior” below). The similar issue was reported, but it was unfortunately closed: https://github.com/DevExpress/testcafe/issues/6578 for missing minimal working example. The size of our application is approximately 35Mb. I noticed the issue on v. 1.16.1. and 1.17.1. Everything works well on v. 1.15.0. There are no issues on Edge or Chrome at all.

What is the Current behavior?

Running test on Firefox browser leads to termination of the test. Error appears in console:

   1) A JavaScript error occurred on "http://localhost:8080/accordion-item".
      Repeat test actions in the browser and check the console for errors.
      To ignore client-side JavaScript errors, enable the "--skip-js-errors" CLI option, or set the "skipJsErrors" configuration file property to "true".
      If the website only throws this error when you test it with TestCafe, please create a new issue at:
      "https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".

      JavaScript error details:
      too much recursion
      e/</Sh</e.prototype._replaceUrlAttributes@http://172.28.3.110:50328/hammerhead.js:9:1687
      e/</Sh</e.prototype.process@http://172.28.3.110:50328/hammerhead.js:9:923
      e/</lf</t._processTextContent@http://172.28.3.110:50328/hammerhead.js:10:24481
      e/</lf</t.prototype._prepareNodesForInsertion@http://172.28.3.110:50328/hammerhead.js:10:18797
      e/</lf</t.prototype._addNodeCore@http://172.28.3.110:50328/hammerhead.js:10:18217
      appendChild@http://172.28.3.110:50328/hammerhead.js:10:20972
      S@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5926
      B@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:4716
      O@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:2613
      A.exports@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5197
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6483
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6409
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6362
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:950
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:959

Running the same test on Edge or Chrome browser does not cause any issues.

What is the Expected behavior?

Running test on Firefox should not lead to termination of the test.

What is your public website URL? (or attach your complete example)

n/a

What is your TestCafe test code?

fixture`Firefox test`
    .page(`http://localhost:8080/button`);
test.only('Should execute test on Firefox browser', async () => {
    await t.click(Selector('#basicButton'));
});

Your complete configuration file

No response

Your complete test report

$ testcafe firefox:headless **.e2e-spec.ts
 Running tests in:
 - Firefox 94.0 / Windows 10

 Firefox test
 × Should execute test on Firefox browser

   1) A JavaScript error occurred on "http://localhost:8080/button".
      Repeat test actions in the browser and check the console for errors.
      To ignore client-side JavaScript errors, enable the "--skip-js-errors" CLI option, or set the "skipJsErrors" configuration file property to "true".
      If the website only throws this error when you test it with TestCafe, please create a new issue at:
      "https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md".

      JavaScript error details:
      too much recursion
      e/</Sh</e.prototype._replaceUrlAttributes@http://172.28.3.110:51660/hammerhead.js:9:1687
      e/</Sh</e.prototype.process@http://172.28.3.110:51660/hammerhead.js:9:923
      e/</lf</t._processTextContent@http://172.28.3.110:51660/hammerhead.js:10:24481
      e/</lf</t.prototype._prepareNodesForInsertion@http://172.28.3.110:51660/hammerhead.js:10:18797
      e/</lf</t.prototype._addNodeCore@http://172.28.3.110:51660/hammerhead.js:10:18217
      appendChild@http://172.28.3.110:51660/hammerhead.js:10:20972
      S@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5926
      B@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:4716
      O@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:2613
      A.exports@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:5197
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6483
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6409
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:6362
      N@http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:146
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:950
      @http://localhost:8080/scripts.f9c6a0ac383dd1b470f8.js:2:959

      Browser: Firefox 94.0 / Windows 10

         328 |});
         329 |
         330 |fixture`Firefox test`
         331 |    .page(`http://localhost:8080/button`);
         332 |test.only('Should execute test on Firefox browser', async () => {
       > 333 |    await t.click(Selector('#basicButton'));
         334 |});
         335 |
         336 |
         337 |
         338 |

Screenshots

No response

Steps to Reproduce

  1. Build any application of minimal size 35Mb.
  2. Run any test on Firefox.
  3. See that test is terminated and that error appears in console.

TestCafe version

1.16.1, 1.17.1

Node.js version

14.16.1

Command-line arguments

testcafe firefox:headless **.e2e-spec.ts

Browser name(s) and version(s)

Firefox 94.0.2

Platform(s) and version(s)

Windows 10

Other

JavaScript error can be ignored by “-e” command. In such case test runs, but it’s not a solution. Behavior is not dependent on headless mode, issue is reproducible in headed mode too. Our assumption is that issue is related to the size of application, we tried to run tests on publicly accessible pages, but issue did not occur. Closed issue https://github.com/DevExpress/testcafe/issues/6578 also points to #1481 and DevExpress/testcafe-hammerhead#1716.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
aleks-procommented, Jan 31, 2022

Hello @vizdatom ,

Thank you for the example. I reproduced the issue. We will investigate it and update this thread once we have any results.

1reaction
Farfurixcommented, Dec 3, 2021

@PierreRott

Hello,

Thank you. We will update this thread once we have any results.

For the team: It looks like the test application overrides the String.replace and Array.indexOf methods we use in our style processor (StyleProcessor._replaceUrlAttributes). This leads to this error. We need to replace the methods with native ones.

Read more comments on GitHub >

github_iconTop Results From Across the Web

InternalError: too much recursion - JavaScript - MDN Web Docs
The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function...
Read more >
A "too much recursion" error in Firefox only sometimes?
Anyway, when the too much recursion error happens, it continues to happen until I restart Firefox. when I restart Firefox it all works...
Read more >
A Definitive Guide to Handling Errors in JavaScript - Kinsta
Getting tripped up by errors in your JavaScript? We'll show you how to tame those errors so you can get back to developing...
Read more >
Outlook 365 stopped loading - Console shows Internal Error
Outlook 365 stopped loading - Console shows Internal Error: Too much recursion. So - for the past few days, Outlook 365 web app...
Read more >
JavaScript - Wikipedia
JavaScript often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found