-
Notifications
You must be signed in to change notification settings - Fork 86
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
InjectAxe fails on cy.readFile error when using Cypress Webpack Preprocessor #84
Comments
One thing to mention: I'm running Ubuntu 18.04. My colleagues on Macs are not experiencing this error when running the same code. |
I think this is a bug in the The command currently looks like this:
The problem is that In the
|
Would love to see a solution for this since I am using Cucumber with Cypress and I need |
@dogriffiths I tested your solution and I was able to get past I'm wondering if there is a bigger issue here. Were you able to successfully call |
No. I had a similar issue, but in my case I was able to switch from using web pack (I only needed it for Typescript). Have you tried temporarily switching back to version 0.9.1? I believe that does not have this issue, because it doesn’t make the web pack module assumption. |
I installed the latest version of everything and was able to get it to work without modifying the core code. I have a mono repo so I have some other issues but not related to this. |
This is the most popular workaround #6 (comment). However it doesn't quite work in all cases - at least not for me. It does get rid of the original error, but once you call
I think the reason the original workaround didn't work is because of some webpack config I have or possibly the script is injected into the wrong window (Cypress has 2 windows, I did find that |
Thank you @kevin-donovan-zocdoc! I had to apply your workaround when working in an Nx monorepo because Nx wires up TypeScript support for you using |
I'm seeing the following error when running
cy.injectAxe
in my Cypress tests:require.resolve('axe-core/axe.min.js')
seems to evaluate to"0764"
instead of the intended JS.This issue seems to be connected to Cypress's Webpack Preprocessor, which I'm using to handle importing files with absolute path aliases.
When I remove the
on('file:preprocessor')
listener from myplugins.js
, file, thecy.injectAxe
command succeeds.Node version: 12.13.1
Cypress version: 6.3.0
@cypress/webpack-preprocessor version: 5.5.0
The text was updated successfully, but these errors were encountered: