-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Migration to v10.3.1 - Cypress configuration error Cannot find module 'cypress-webpack-preprocessor-v5' #22895
Comments
@marktnoonan could it be because we don't have a cypress folder ? Ours is called icm-web-cypress-ui |
Can you share your Also, if you are opening Cypress 10.x for the first time, there is a migration UI that helps you change from Also, although you should be able to go from Cypress 8->10, it might be better to update to Cypress 9 first. The migration tool should work fine, but it's possible there are breaking changes from Cypress 8->9 that might be hard to debug if you skip an entire major version. |
Hi @lmiller1990 As a test, I actually commented out the entire plugins/index.js and opened cypress. The migration screen showed up this time but instead of starting the migration with the step to rename specs to cy files, it started at the step to migrate the configs. It looks like it's not able to retrieve the spec files. I wonder if once again it's due to an assumption that the spec files are under cypress directory. It also skipped the renaming of the support file by the way. So only 1 step out of the 3 is working. Do you have any suggestions to bypass these problems ? If not, how long will it take to address the issue ? Here is the cypress.json file
|
That's strange, we definitely have logic considering the Are you able to create a minimal reproduction? Alternatively, can you try again, but run with A minimal reproduction would be most ideal, but if that's difficult, debug logs are useful, too. |
@lmiller1990 Unfortunately I haven't been successful in trying to create a minimal reproduction :( Note : Our spec files naming convention does not use spec by the way, here is an example : TestName-test.ts Here are the debugging logs :
|
Nothing obviously wrong in debug logs. I do see |
Hi @kevingorry Maybe changing from I can imagine the package So might be you only have to uninstall If that is the fix maybe the Cypress Migration Tool could check for this scenario too and support automatically? |
@lmiller1990 we are not using Yarn 3 yet but yarn-2.4.2.cjs |
@leschdom same thing @rockindahizzy anything else I should try ? I'm blocked |
Thanks for your reply @kevingorry. Might be a silly question but did you You may also check the if the packages are installed via:
In my case it looks like:
|
Yes I installed it properly. I don't think it's specific to this package because if I comment out the line that make use of it in plugins/index.js it complains about the next line Error: Cannot find module 'glob' For what it matters we are using : I feel like it's somewhat related to https://stackoverflow.com/questions/72799261/cannot-find-module-cypress-code-coverage-task |
Just to clarify - if you make a new project with Cypress 9.x run the examples tests, then update, do you have the same error? Is this problem related to your environment or your project specifically, I wonder? Also, did you try with Yarn 1.x? That would be another thing to test - gradually change bits and pieces until you isolate the problem. Another question - is Cypress installed in your project, or globally? Without a reproduction, I am not sure how much assistance I can be 😢 |
@lmiller1990 so here is an update on both issues :
I think this is happening because Cypress is looking at a different node_modules folder. It seems that it looks for node_modules under icm-web-cypress-ui (where Cypress is installed) rather than .yarn/cache/xxx
I found out that if I have the integration folder under icm-web-cypress-ui (where Cypress is installed) then Cypress migration tool is not able to see the spec files to migrate. Even with the cypress.json as such I have to add a cypress folder under icm-web-cypress-ui for this to work and I have to update the cypress.json Only then the migration tool can see the spec files. Why is that ? |
I think this is the same as: Problem is we use Unfortunately I don't think there is a user land fix for this, we need to add Yarn 2+ support in the main repo (not sure how to do this, someone needs to pick it up). I will see if I can get something going soon - if you'd like to look into it, you are welcome too, I am not sure how trivial this fix is. Thanks for the useful debugging info so far - it's really useful. |
@lmiller1990 thank you for the explanation. With regards to the second issue, any idea what is causing this ? I looked at this repo https://github.com/cypress-io/cypress/tree/develop/system-tests/projects/migration-e2e-custom-integration and the setup is indeed fairly similar but I'm not prompted to migrate the spec files...only if I create that cypress folder as mentioned above. |
^ That is definitely strange. Any chance you can provide a minimal reproduction? I can't help but think it's a combination of Yarn 2+ with the alternative node_modules resolution or something to do with how the monorepo is set up. It's also possible to do a manual migration - not sure if this will be useful, though, if the initial Yarn 2 issue is preventing you from moving forward. Raising Yarn 2+ compat internal as a priority. In the meantime, I can try reproduce on my end. |
Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen. |
Current behavior
We are on Cypress 8.5 and we decided to upgrade to v10.3.1. Currently 8.5 is working perfectly fine when doing a yarn cypress open
After installing v10.3.1 and running yarn cypress open I see this error instead of the migration screen.
Desired behavior
Migration screen
Test code to reproduce
See details
Cypress Version
10.3.1
Other
cy-ts-preprocessor.js
plugins/index.js
The text was updated successfully, but these errors were encountered: