partytown
partytown copied to clipboard
Configuring Partytown to work with `axe-core`
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:
The following is how the flattened tree that axe constructs looks with Partytown. The actualNode
attribute gets replaced by a WorkerBase
:
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.
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:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- 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.
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 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.
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.