percy / cli

The Percy CLI is used to interact with, and upload snapshots to, percy.io via the command line.
https://docs.percy.io/docs/cli-overview
71 stars 45 forks source link

Attempted to upload multiple resources with the same resource-url, error processing resource? #641

Closed IanVS closed 2 years ago

IanVS commented 2 years ago

The problem

I've reached out to percy support, but I think it might be worth opening this as well, for others who might be hitting the same issue. I'm seeing an issue similar to https://github.com/percy/cli/issues/388, getting the following error:

Error: Attempted to upload multiple resources with the same resource-url

When I run in debug mode, I see other errors, though:

[percy:core:discovery] Encountered an error processing resource: https://61a5059a7c56a0000743f249--defined.netlify.app/assets/vendor.50c1bd61.js (69ms)
11:55:18 AM: [percy:core:discovery] Error: Protocol error (Network.getResponseBody): No data found for resource with given identifier

But from what I can tell, the file is indeed available. So I'm not sure what's going on.

Environment

Details

Debug logs

The logs are a big long, so here's a gist with them:

https://gist.github.com/IanVS/908aa0340f0e66085576f9d0758e5adf

Code to reproduce issue

The site I'm snapshotting is https://61a5059a7c56a0000743f249--defined.netlify.app, and I've added a snapshots.js file in the gist. I'm using something like DEPLOY_URL=https://61a5059a7c56a0000743f249--defined.netlify.app/ percy snapshot snapshots.js to execute it.

IanVS commented 2 years ago

Not sure if this is helpful, but it sounds like this can happen when calling Network.getResponseBody before the Network.loadingFinished event has fired. See https://github.com/cyrus-and/chrome-remote-interface/issues/260.

patricknelson commented 2 years ago

@IanVS just wondering: Did you have a #hash in your URL by any chance? Because, oddly, that's what seemed to induce it for me (may be an edge case and something deeper happening in our site). I was able to resolve it by removing the #toggle-faq hash that I had in the affected page's URL. The hash was just what I was using for a previous VQA solution, now I just use the execute setting to toggle what I need.

patricknelson commented 2 years ago

Yeah these bugs are driving me nuts @Robdel12 😢. I'm guessing it's not relating to the incorporation of hashes into the URL as it's cropping up for me repeatedly on pages even if I try to differentiate them with a query string. It seems to happen more frequently if the contents of the pages are similar, but... beyond that?

It'd be nice to not have to skip pages.

Based on what I'm seeing from @IanVS's link above (actually very helpful): Could it be a race condition?

EDIT: My issue may be unrelated (the fixing PR #849 didn't resolve)