Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crossorigin attribute to all 3rd party scripts #643

Closed
bahmutov opened this issue May 30, 2018 · 2 comments
Closed

Add crossorigin attribute to all 3rd party scripts #643

bahmutov opened this issue May 30, 2018 · 2 comments

Comments

@bahmutov
Copy link
Contributor

Sometimes e2e tests fail on CI with 3rd party syntax error

1) API Catalog of events "before each" hook for "loads catalog of events":
     Uncaught Error: Script error.

Cypress detected that an uncaught error was thrown from a cross origin script.

We cannot provide you the stack trace, line number, or file where this error occurred.

Check your Developer Tools Console for the actual error - it should be printed there.

It's possible to enable debugging these scripts by adding the 'crossorigin' attribute and setting a CORS header.

https://on.cypress.io/cross-origin-script-error

Example of a failed build https://circleci.com/gh/cypress-io/cypress-documentation/3965#tests/containers/0

We can add crossorigin to 3rd party script builds to show the actual error

@nachocab
Copy link

@bahmutov could you explain how to do this? I keep running into these errors and I don't know how to set that attribute or the CORS headers in my local environment

@Jelle-vz
Copy link

Jelle-vz commented Oct 3, 2019

@nachocab check your code and add 'crossorigin="anonymous"' to the third party script that is giving you problems.

See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes for the full spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants