Title: Javascript errors
Last modified: December 30, 2021

---

# Javascript errors

 *  Resolved [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/)
 * New to web stories and trying to get everything sorted. Analytics events don’t
   seem to be firing, and in looking into the cause I noticed some JS errors.
 * > `Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’: The canvas
   > has been tainted by cross-origin data.
   >  U @ error-reporting.js:206 background-
   > blur.js:144 Uncaught (in promise) DOMException: Failed to execute ‘getImageData’
   > on ‘CanvasRenderingContext2D’: The canvas has been tainted by cross-origin 
   > data. at Eg ([https://cdn.ampproject.org/v0/amp-story-1.0.mjs:5:113775](https://cdn.ampproject.org/v0/amp-story-1.0.mjs:5:113775))
   > at [https://cdn.ampproject.org/v0/amp-story-1.0.mjs:5:113101](https://cdn.ampproject.org/v0/amp-story-1.0.mjs:5:113101)`
 * I read some previous discussions about CORS issues others were having but not
   sure this is related. It appears our headers are set to allow Access-Control-
   Allow-Origin.
 * Any idea what could be causing these JS errors? Would this prevent analytics 
   from working correctly?

Viewing 12 replies - 1 through 12 (of 12 total)

 *  [Bethany Chobanian Lang](https://wordpress.org/support/users/mxbclang/)
 * (@mxbclang)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15209483)
 * [@trek7k](https://wordpress.org/support/users/trek7k/) Thanks for getting in 
   touch. I agree; these don’t appear to be standard CORS errors to me, but I’d 
   like to do some more investigation. To do that, can you please share the following
   info?
    1. The URL of a story or stories that are showing these JS errors
    2. Your [Site Health information](https://i.imgur.com/Rtkmsba.png) privately [via this form](https://forms.gle/Vzr9yBHiEMzfBN1j8)
 * Thank you!
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15215596)
 * Thank you Bethany, I have provided the info via the form.
 *  [Adam Dunnage](https://wordpress.org/support/users/adamdunnage/)
 * (@adamdunnage)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15216753)
 * [@trek7k](https://wordpress.org/support/users/trek7k/) thanks for providing this
   information. I can see that your story is failing [AMP validation](https://search.google.com/test/amp/result?id=IjekJDek1-eWWzb7rn6UWg).
 * Looking at the information provided I can see that you are using W3 Total Cache.
   Would you please be able to temporarily disable this plugin and check your story
   once more to see if this clears those validation errors?
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218032)
 * I can’t disable it on the production site, but have done so on our development
   server. I have sent that information via the form Bethany linked above.
 * The error seems to persist even with W3TC turned off.
 * Edit: As a bit of additional info, the production site sits behind Cloudflare,
   however the development site does not so there shouldn’t be any caching or CDN
   interference there. We initially thought Cloudflare might be causing the issue,
   however we are seeing the same JS errors in both environments.
    -  This reply was modified 4 years, 5 months ago by [trek7k](https://wordpress.org/support/users/trek7k/).
      Reason: additional info
 *  [Adam Dunnage](https://wordpress.org/support/users/adamdunnage/)
 * (@adamdunnage)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218106)
 * [@trek7k](https://wordpress.org/support/users/trek7k/) thanks for letting me 
   know. I can see that you have a number of plugins active on your site and it 
   would be good to rule out any possible plugin conflict. To do this please could
   you follow the steps below. Note that doing this only affects a logged in users
   experience and won’t change what a visiting site user will see.
 * Use the [Health Check & Troubleshooting plugin](https://wordpress.org/plugins/health-check/)
   and enable its [troubleshooting mode](https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/#troubleshooting).
   This mode disables active plugins and switches to a default theme safely because
   it only affects the experience of the logged-in user.
    - Please enable the [Web Stories plugin](https://jumpshare.com/v/QNl7doshW4cU2tpfEtDZ)
      and let me know if you still get the issue.
    - Enable plugins and your theme one by one in this mode may help pinpoint if
      something else is involved.
    - Note you can [disable troubleshooting mode](https://jumpshare.com/v/QNl7doshW4cU2tpfEtDZ)
      from the plugins page.
 * This will confirm and highlight any plugin causing an issue. Please let me know
   if you have any further questions.
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218220)
 * Have deactivated all plugins except web stories, and have switched to fresh twentytwentyone
   theme on dev server and are still getting the JS errors.
 * Looking at the source generated by the web story, it seems unlikely the theme
   or any plugin would be causing this since none of our site CSS/JS/etc. is being
   included or referenced in the HTML, even with everything activated. Everything
   appears to be coming from ampproject and stories.google.
 * Both our live and production sites are hosted by AWS, and obviously there are
   a ton of configuration variables involved there. Could it be something at the
   server level that is mixing origins, possibly in the headers?
 *  [Adam Dunnage](https://wordpress.org/support/users/adamdunnage/)
 * (@adamdunnage)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218495)
 * [@trek7k](https://wordpress.org/support/users/trek7k/) thanks for trying the 
   above steps. This does look like something is being blocked at the hosting level
   as you have suggested.
 * Unfortunately as this is the case then there isn’t anything we can do to help
   you with this and would advise reaching out to your hosting provider who should
   be able to assist your further.
 * If you do have any other questions about Web Stories or any further issues then
   please do let us know and we can assist you with those.
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218671)
 * Bummer, thanks anyway. Like I said, we checked to make sure that the headers 
   are configured correctly (Access-Control-Allow-Origin etc.) so if you can think
   of any reason that the canvas could become tainted with cross-origin data, please
   let me know. It does seem like this is something specific to our server setup
   since others have not noted this issue with the web stories plugin.
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15218924)
 * Will be investigating and sharing anything we find on our end in case others 
   have a similar issue.
 * Tried publishing one of the story templates as is, and the errors disappear. 
   It seems it is the images in our story that are supposedly cross origin tainting
   the canvas. The images are hosted on a subdomain (images.example.com) so not 
   on the same server as the page, however the template stories also use images 
   stored on another server (wp.stories.google) and do not throw the error.
 * It *could* be an issue with the headers returned by S3 so that’s the next area
   to investigate. A lot of sites use Amazon S3 for image hosting so I’m surprised
   others have not run into this yet…
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15219200)
 * Upon further testing, the cross origin taint error eventually pops up on the 
   final panel even on the templates that use only stock images hosted by google.
 * To confirm our web and image server are not causing the issue, we tested stripping
   out all references to any images stored on our own servers, including the logo
   files etc. Even opening the file locally, the final panel generates the error.
   🙁
 * This is the HTML that was tested locally, and that continues to produce the error.
 * [https://pastebin.com/bsLTLjJt](https://pastebin.com/bsLTLjJt)
 *  Plugin Author [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15219522)
 * Thanks for investigating this!
 * This sounds like a bug in the Web Stories AMP format itself, and I recommend 
   filing a bug accordingly at [https://github.com/ampproject/amphtml](https://github.com/ampproject/amphtml)
 * As the name of that script implies, Web Stories have blurry backgrounds. `getImageData`
   is used for this feature.
 * As far as I can tell, this error should have no effect on your analytics or anything.
 *  Thread Starter [trek7k](https://wordpress.org/support/users/trek7k/)
 * (@trek7k)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15221462)
 * Will do, thanks.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Javascript errors’ is closed to new replies.

 * ![](https://ps.w.org/web-stories/assets/icon.svg?rev=2386543)
 * [Web Stories](https://wordpress.org/plugins/web-stories/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/web-stories/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/web-stories/)
 * [Active Topics](https://wordpress.org/support/plugin/web-stories/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/web-stories/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/web-stories/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 12 replies
 * 4 participants
 * Last reply from: [trek7k](https://wordpress.org/support/users/trek7k/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/javascript-errors-56/#post-15221462)
 * Status: resolved