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

Must restart Cypress to run newly added spec file when using Webpack 5 #16664

Closed
lmiller1990 opened this issue May 25, 2021 · 5 comments
Closed
Labels
npm: @cypress/webpack-dev-server @cypress/webpack-dev-server package issues

Comments

@lmiller1990
Copy link
Contributor

Current behavior

If you add a new spec file after starting the component testing runner, eg touch src/MySpec.spec.jsx, it shows up in the runner, but it always says "no test found", even if you add some tests to the spec file.

You need to restart the runner to webpack to start watching the file correctly.

It only happens for projects using Webpack 5.

Desired behavior

Should work like it does for Webpack 4. I don't want to restart the runner.

Test code to reproduce

  • Get any webpack 5 repo, for example this one https://github.com/lmiller1990/cypress-react-webpack-5-example
  • yarn cypress open-ct
  • touch src/Blah.spec.jsx
  • Click Blah.spec.jsx in the side bar
  • Notice "no tests found"
  • add a test, eg it('something', () => {})
  • observe webpack does not notice the file changed or rebundle it

Versions

  • cypress 7.4.0
  • latest cypress/webpack-dev-server
  • webpack 5.x
  • webpack dev server, probably 3.x
@lmiller1990 lmiller1990 added component testing npm: @cypress/webpack-dev-server @cypress/webpack-dev-server package issues labels May 25, 2021
@lmiller1990
Copy link
Contributor Author

After much investigation I am fairly sure the problem is this line is not doing what it does with Webpack 4.

I don't know how to fix it yet, though, or what changed - this is not even a documented part of Webpack.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 8, 2022

The code for this is done in cypress-io/cypress#17950, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@lmiller1990
Copy link
Contributor Author

#17950 fixes it!

@emilyrohrbough
Copy link
Member

This was released as @cypress/webpack-dev-server v1.8.1 on Feb 10, 2022

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 1, 2022

Released in 10.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.0.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
npm: @cypress/webpack-dev-server @cypress/webpack-dev-server package issues
Projects
None yet
Development

No branches or pull requests

2 participants