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
fix: Avoid require conflict with Cypress [#1405] #1406
Conversation
This seems scary. I'd like to hear more about why this is necessary before OK'ing the code. |
@stephenmathieson Cypress seems to be replacing any variable with the name What is your concern with doing this? I realise that if derequire messes up, this could go wrong, but the same is true for browserify. That's why I used derequire, it's made to do this. |
Wow, OK. That's very strange. I wonder why that is 🤔
I'm just worried about adding another layer of transformation to the codebase, especially since in this PR we're transforming code that we don't own/maintain ( However, since this is urgent, and the tests are all green, let's give this a go 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, just a thought -- would it make more sense to use this as a Browserify transform?
|
Based on #1427, it seems like using axe-core in Cypress still isn't working as expected. |
@stephenmathieson I just want to add that the issue I'm seeing only exists when using webpack to preprocess files. If I let Cypress manage things itself, using axe-core works without issue. |
This is an issue with webpack, I have switched to https://github.com/cypress-io/cypress-browserify-preprocessor which has resolved the issue. |
Use derequire the rename all uses of
require
to_dereq_
to avoid the problem of Cypress overloading therequire
method.Closes #1405
Reviewer checks
Required fields, to be filled out by PR reviewer(s)