Axe-core: [3.2.0] Cannot find module './lib/axios'

Created on 4 Mar 2019  路  3Comments  路  Source: dequelabs/axe-core


Attempts to update axe-core from 3.1.2 to 3.2.0 are causing Cypress tests to fail. From the error message, it looks like it can't resolve axios anymore?

Expectation: no errors

Actual: Error: Cannot find module './lib/axios' from '/root/project/node_modules/axe-core'

Motivation: N/A


axe-core version: 3.2.0
axe-webdriver, extension or other integration version: N/A

Browser and Assistive Technology versions

For Tooling issues:
- Node version: 10  
- Platform: all 

Thanks.

core fix

Most helpful comment

@wKovacs64 @beardedtim looks like this problem is coming form Cypress being unexpectedly aggressive in overloading any variable called require. Axe-core uses an internal require to load its embedded dependencies.

A simple workaround I found is to use axe.min.js instead of axe.js. You can require it from axe-core/axe.min.js.

I'll put together a fix for this. Shouldn't be too difficult, just have to rename that require function.

All 3 comments

Thank you for reporting. Looking into it now.

@wKovacs64 @beardedtim looks like this problem is coming form Cypress being unexpectedly aggressive in overloading any variable called require. Axe-core uses an internal require to load its embedded dependencies.

A simple workaround I found is to use axe.min.js instead of axe.js. You can require it from axe-core/axe.min.js.

I'll put together a fix for this. Shouldn't be too difficult, just have to rename that require function.

Thanks @WilcoFiers & crew!

Was this page helpful?
0 / 5 - 0 ratings