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

[3.2.0] Cannot find module './lib/axios' #1405

Closed
wKovacs64 opened this issue Mar 4, 2019 · 3 comments
Closed

[3.2.0] Cannot find module './lib/axios' #1405

wKovacs64 opened this issue Mar 4, 2019 · 3 comments
Assignees
Labels
core Issues in the core code (lib/core) fix Bug fixes

Comments

@wKovacs64
Copy link

wKovacs64 commented Mar 4, 2019

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.

@WilcoFiers WilcoFiers self-assigned this Mar 5, 2019
@WilcoFiers WilcoFiers added fix Bug fixes core Issues in the core code (lib/core) labels Mar 5, 2019
@WilcoFiers
Copy link
Contributor

Thank you for reporting. Looking into it now.

@WilcoFiers
Copy link
Contributor

@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.

WilcoFiers added a commit that referenced this issue Mar 6, 2019
Use derequire the rename all uses of `require` to `_dereq_` to avoid the problem of Cypress overloading the `require` method.

Closes #1405

## Reviewer checks

**Required fields, to be filled out by PR reviewer(s)**
- [x] Follows the commit message policy, appropriate for next version
- [x] Has documentation updated, a DU ticket, or requires no documentation change
- [x] Includes new tests, or was unnecessary
- [x] Code is reviewed for security by: Stephen
@jeeyyy jeeyyy mentioned this issue Mar 6, 2019
1 task
@wKovacs64
Copy link
Author

Thanks @WilcoFiers & crew!

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
Projects
None yet
Development

No branches or pull requests

2 participants