partytown icon indicating copy to clipboard operation
partytown copied to clipboard

Configuring Partytown to work with `axe-core`

Open khiga8 opened this issue 2 years ago • 1 comments

I posted in the Discord channel but figured I should file an issue too for posterity.

I was hoping to configure axe-core to run in Partytown. I started exploring this path and ran into some blockers. Without understanding too much about Partytown's inner workings, I see that Partytown replaces DOM elements with a WorkerBase.

Here in this screenshot we can see how the flattened tree that axe constructs looks without Partytown. The actualNode attribute is an actual DOM element: Screenshot of axe's flattened tree output when partytown is disabled

The following is how the flattened tree that axe constructs looks with Partytown. The actualNode attribute gets replaced by a WorkerBase: Screenshot of axe's flattened tree output when partytown is enabled

When axe makes this getSelectorData call to access information about the DOM elements from the constructed tree, I run into the following:

Uncaught DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http:/localhost:3000/~partytown/debug/proxytown'.

I'm not sure why I'm getting error. If anyone is able to successfully get axe-core working with Partytown, would love to hear from you.

khiga8 avatar Apr 29 '22 21:04 khiga8

hey @khiga8 - we've just created an issue template, could you update your issue here to provide all the information the template asks for? it'll help us look into your issue https://github.com/BuilderIO/partytown/issues/new?assignees=&labels=&template=bug_report.md&title=

pasting below to make things easier:


Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Reproduction link Please include a link to a Stackblitz or Codesandbox reproducing the issue. We will need to see the issue reproduced with hand-written code - we can't debug giant minified third party scripts directly. If you do not include a clean and simple reproduction of your issue, we won't be able to look into it until you do.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

steve8708 avatar May 28 '22 19:05 steve8708

Did you get anywhere with this? I'm having a similar issue, it seems to me that this proxytown url there doesn't have anything that replaces it? I do see some onfetch pathname.endsWith("proxytown") && ev.respondWith(httpRequestFromWebWorker(req)); in partytown-sw.js but this is not called then (from briefly looking at all the code... )

dio5 avatar Oct 05 '22 16:10 dio5

@dio5 Unfortunately not, I ended up abandoning the effort. I recommend joining the Discord group if you haven't already. There might be someone who can help now.

khiga8 avatar Oct 07 '22 13:10 khiga8

Closing this issue since it has become stale, or has been addressed in recent releases and docs updates. If you feel this is still an issue please reopen a new issue. Thanks.

adamdbradley avatar Mar 21 '23 15:03 adamdbradley