percy / percy-agent

[Deprecated in favor of `@percy/cli`] An agent process for integrating with Percy.
https://percy.io
MIT License
22 stars 25 forks source link

"Synchronous XMLHttpRequest on the main thread is deprecated" warnings #30

Closed toolmantim closed 5 years ago

toolmantim commented 5 years ago

When using https://github.com/percy/percy-puppeteer I receive the following warning:

(node:72) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: console.warning not allowed in production: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

It looks like it's due to https://github.com/percy/percy-agent/blob/master/src/percy-agent-client/percy-agent-client.ts#L18

djones commented 5 years ago

Hi @toolmantim,

I believe this is now fixed, especially for the @percy/puppeteer SDK because we've changed the way a page communicates with the agent.

It used to communicate directly from within the page being tested (and making the warning you've reported here), but we've rolled out a bunch of updates that make that call to the agent happen from the SDK itself. Example of this https://github.com/percy/percy-puppeteer/pull/36

Upgrade to the latest @percy/puppeteer SDK and you should be all set.

Thanks, David.

toolmantim commented 5 years ago

Thanks David!