equal-access: [BUG]: Latest version 3.1.41 throws an error and crashes
Project
a11y checker engine
Browser
Chrome, Safari, Firefox
Operating system
MacOS, Other
Description
-
We use the accessibility checker in a React project.
-
We are using version “^3.1.40” that automatically picks up any new minor/patch version.
-
Since the time version 3.1.41 has been released our accessibility tests fail with the following error:
Error: Cannot find module '@babel/runtime-corejs3/helpers/interopRequireDefault' from '../../../../../tmp/accessibility-checker/engine/ace-node.js'
-
When we fixate the version to be 3.1.40 the error is not reproducible any longer.
-
Additionally I add here how we use
accessibility-checker
. All components are used with the following function:
/**
* Runs the accessibility scan and on failure, outputs the results.
*/
async function runAAT(component, label) {
const validateComponent = async () => {
const results = await AAT.getCompliance(component, label);
if (AAT.assertCompliance(results.report) === 0) {
return true;
}
return false;
};
const a11yValidation = await validateComponent();
if (a11yValidation === true) {
fs.unlinkSync(`${process.env.PWD}/results/a11y/${label}.json`);
}
return a11yValidation;
}
Steps to reproduce
- Install “accessiblity-checker”: 3.1.41.
- Have tests using the
getCompliance
andassertCompliance
functions. - Error is thrown:

And after this initial error… every test fails with the following error message:

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (12 by maintainers)
@grabowsd This package is missing from the latest release of
accessibility-checker
as seen here@tombrunet, thanks for your help! Adding
transformIgnorePatterns: ["/node_modules/", "\\.pnp\\.[^\\\/]+$", "ace-node\\.js"],
to our jest config solved the issue.Note
"/node_modules/", "\\.pnp\\.[^\\\/]+$"
istransformIgnorePatterns
default value without whichaccessibility-checker
was throwing errors.@carlosparreno While digging into something else, I found perhaps a cleaner fix for this. Add this to your jest config instead of changing the cache folder
"transformIgnorePatterns": ["ace-node\\.js"]
By default, Jest injects babel into all js/jsx files. This tells Jest not to do that for the engine.Hi at @tombrunet and @sct-will, Thanks for providing a fix.
I installed the latest version of accessibility-checker 3.1.43 that I believe contains the fix but I’m getting the following error:
I’m not sure if this is related to the same issue of cacheFolder in config but it looks like when I’m importing modules from accessibility-checker to run with Jest it cannot find
string-hash
module required inmultiScanData.js
. Is this something that I need to install separately?That PR should resolve relative paths as absolute, which should be released next week, but that’s something you can try if you’re in a hurry.
Quick test on our end had no failure. We don’t have any imports in the ace-node.js file - you can open https://unpkg.com/accessibility-checker-engine@3.1.41/ace-node.js and search and see that that
@babel
is not referenced anywhere. I’ll try to run through some of our boilerplates to see if there’s some react combination that’s triggering that, but it seems like something in your environment is injecting into that file. Can you possibly include a copy of your ace-node.js file so we can compare against the original?