Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Expect axe._selectorData to be set up" console errors #1867

Closed
chimericdream opened this issue Oct 22, 2019 · 10 comments
Closed

"Expect axe._selectorData to be set up" console errors #1867

chimericdream opened this issue Oct 22, 2019 · 10 comments
Assignees
Labels
core Issues in the core code (lib/core) fix Bug fixes performance Performance related issues

Comments

@chimericdream
Copy link

I'm getting the following error in the browser console when running aXe in my React app:

2019-10-22 08_27_28-Window

I saw this was reported on the react-axe repository, but it appears the root issue is in axe-core. I saw that the selector code had minor changes in 3.4.0 released today, but they did not fix the issue for me.

I saw similar, possibly related issues here (#1041 and #1084), but I wasn't sure if they were true duplicates. If so, I'll throw my +1 into those tickets for a fix.

Versions and environment

Thanks!

@WilcoFiers
Copy link
Contributor

This is very likely because axe is started a second time before it completed the first. Axe-core can't have multiple runs going at the same time. @straker and I discussed last week if we could put together some kind of queue, so that axe-core doesn't start a run while another is still going. I think that's the best way to solve this.

@WilcoFiers WilcoFiers added fix Bug fixes core Issues in the core code (lib/core) performance Performance related issues labels Oct 23, 2019
@mohanraj-r
Copy link
Contributor

I am also seeing this error after upgrading to 3.4.0. Did not see this error with 3.3.1.

@WilcoFiers
Copy link
Contributor

@mohanraj-r are you also using react-axe, or something else?

@mohanraj-r
Copy link
Contributor

@WilcoFiers I am using it via https://github.com/nickcolley/jest-axe on some custom components (not react)

@WilcoFiers
Copy link
Contributor

@mohanraj-r Are you kicking off multiple axe.run() calls at the same time? That's not supported. You need to await a run before you start the next. You can do that pretty easily just doing await axe(html) in jest-axe.

@mohanraj-r
Copy link
Contributor

@WilcoFiers Yes the axe.run() calls are being triggered in parallel by jest as it runs tests in parallel. I thought jest had isolation between the parallel tests - e.g. by using a different instance of jsdom for each parallel run. Maybe I should try using jest.resetModules()?

@mohanraj-r
Copy link
Contributor

Btw do you know why this is happening only in recent versions of axe ?
Wondering if I can workaround this if I know what is causing this..

@straker
Copy link
Contributor

straker commented Nov 21, 2019

@jeankaplansky docs needed about how axe.run will now throw an error for concurrent runs: "Axe is already running. Use await axe.run() to wait for the previous run to finish before starting a new run."

@straker straker self-assigned this Nov 21, 2019
@padmavemulapati
Copy link

@jeankaplansky , is this documented? If yes , can you please mension the link here, I will verify and close this ticket.
@straker , I am seeing the code changes.

@padmavemulapati
Copy link

Apart from release doc, there is no specific axe related documentation to verify, so closing this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes performance Performance related issues
Projects
None yet
Development

No branches or pull requests

5 participants