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.

Getting Error: Script error. (:0) - How to resolve?

See original GitHub issue

Current behavior:

Cypress test run fails on Chrome in before() with a cryptic error message:

Error: Script error. (:0)

Because this error occurred during a ‘before all’ hook we are skipping the remaining tests in the current suite: ‘Pets - Feed item’

Please see this screenshot:

image

Desired behavior:

A detailed error message should appear and should include clear instructions on how to resolve the problem.

Steps to reproduce: (app code and test code)

I’ve not been able to reproduce based on cypress-test-tiny repo so I’ve created a private repo containing a full test suite. I’ve sent emailed instructions on how to access it to support@cypress.io.

To reproduce using said repo, please:

  1. Clone to Ubuntu.
  2. Run npx cypress open.
  3. Run this spec file: sanity/pets/feed_item.spec.js

Versions

Cypress v3.4.0 Ubuntu 16.04 LTS Chrome 75

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
bahmutovcommented, Aug 15, 2019

The best workaround to see the source of error right now on the Guardian website for example is:

  1. Look at the current error - keep DevTools open while the test is running
Screen Shot 2019-08-15 at 11 31 43 AM
  1. Set in cypress.json
{
  "chromeWebSecurity": false
}

Then rerun the test with DevTools open again and it should see better errors

Screen Shot 2019-08-15 at 11 32 34 AM
  1. Notice that the scripts throwing hundreds of errors come from domain assets.guim.co.uk so add it to the blacklists in cypress.json
{
  "chromeWebSecurity": false,
  "blacklistHosts": "assets.guim.co.uk"
}
  1. This might reveal more errors coming from other locations.
Screen Shot 2019-08-15 at 11 36 26 AM
  1. Add the new source of errors to cypress.json
{
  "chromeWebSecurity": false,
  "blacklistHosts": ["assets.guim.co.uk", "interactive.guim.co.uk"]
}

and finally the site loads

Screen Shot 2019-08-15 at 11 38 16 AM
4reactions
sebike88commented, Jul 22, 2019

Having the same issue but i managed to find a workaround, in my case at least. Try setting "chromeWebSecurity": false in cypress.json. Before disabling web security i was getting Error: Script error. (:0), after disabling it cypress was logging the correct error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Script error code 0 - Microsoft Community
Method 1: If you receive get script error while using Internet Explorer then follow the suggestion from the link and check if it...
Read more >
How to Fix Script Error Pop Up in Windows 10, 11 - YouTube
Steps by steps guide: https://bonguides.com/how-to- fix - script - error -pop-up-in-windows-10-11/- Fix Script Error on Windows 11/10.
Read more >
Fix Script Error on Windows 11/10
Disable the Script Error Notification; Remove All temporary internet files; Update the application causing the problem. You may not need an ...
Read more >
How to best resolve script error messages on personal computer
Script error messages tend to appear when one's browser is out of date.
Read more >
How to Troubleshoot Script Error Code 0 on LabVIEW - NI
If you encounter a script error when you are using the ActiveX browser in LabVIEW, you can disable this error notification by changing...
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