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

Warnings with Webpack 5 #106

Open
Develliot opened this issue Sep 23, 2021 · 5 comments · May be fixed by #120
Open

Warnings with Webpack 5 #106

Develliot opened this issue Sep 23, 2021 · 5 comments · May be fixed by #120

Comments

@Develliot
Copy link

WARNING in ./node_modules/cypress-axe/dist/index.js 16:47-54
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./cypress/support/index.js 3:0-21
 @ ./node_modules/@cypress/webpack-dev-server/dist/loader.js!./node_modules/@cypress/webpack-dev-server/dist/browser.js 2:30-69
 @ ./node_modules/@cypress/webpack-dev-server/dist/browser.js 3:4-41

WARNING in ./node_modules/cypress-axe/dist/index.js 16:77-84
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./cypress/support/index.js 3:0-21
 @ ./node_modules/@cypress/webpack-dev-server/dist/loader.js!./node_modules/@cypress/webpack-dev-server/dist/browser.js 2:30-69
 @ ./node_modules/@cypress/webpack-dev-server/dist/browser.js 3:4-41
@Develliot
Copy link
Author

I don't think I found what fixed this it might have been a magical combination of webpack and webpack cli / dev server version numbers because I was using Cypress component testing.

Also I moved all my commands using cypress-axe from support/command to support/index and everything seems to be working now.

@Develliot
Copy link
Author

Another tip is that if you update to the new webpack dev server, may be you are running tests with cypress component tests you probably want to set the webpack config with something like this:

  devServer: {
    host: "0.0.0.0",
    port: 8080,
    client: {
      overlay: {
        errors: true,
        warnings: false,
      },
    },

because these warns start to appear in an overlay which will cause your tests to fail.

@marcysutton
Copy link

I get this same warning with Webpack 4 and Cypress Component Testing. I wasn't encouraged much by the related thread on the axe-core repo but I can confirm the webpack config setting to disable overlay warnings works! Thanks for that. Here are the docs I used, if anyone else needs them: https://webpack.js.org/configuration/dev-server/#overlay

@smmccabe
Copy link

smmccabe commented Feb 3, 2022

here is a PR that fixes this issue. #120

@srikanthkyatham
Copy link
Contributor

Seems this issue could be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants