This item is very much related to: Exception in nrWrapper
But the other one is closed, so trying to re-raise the discussion here.
Cypress and NewRelic does not play nicely.
Just ignoring the error on the cypress using some form of :
Is obviously just ignoring it and we want to avoid this, not ignore it…
At least in our case, we also do not want to load newrelic JS on cypress tests in any case.
So there are two obvious options:
- In the case of cypress tetsing, block the load of newrelic scripts.
- Or, In the case of cypress testing, do not load the newrelic scripts.
The first option, which means, in the cypress browser, use “blockHosts” and block scripts from ‘js-agent.newrelic.com’ does not work because the issue is already on the bootstrap script in the ‘NREUM’ thingi.
The second option might be possible, e.g. somehow detecting cypress on the newrelic agent and not serving the NREUM script.
Basically sending a flag from cypress to skip this, (as an example on the python agent):
I am wondering if anyone else is coming across this and found a good solution.