-
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
fix: do not cache module resolution during launchpad dependency detection #26726
Conversation
@@ -43,7 +43,7 @@ export async function isDependencyInstalled (dependency: Cypress.CypressComponen | |||
// for module resolution. | |||
const resolvePackagePath = require('resolve-package-path') | |||
|
|||
const packageFilePath = resolvePackagePath(dependency.package, projectPath) | |||
const packageFilePath = resolvePackagePath(dependency.package, projectPath, false) |
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.
This is the fix, the third arg is whether to cache or not - we don't want caching, or it won't find the dependency, even if the user adds it.
@@ -8,8 +8,7 @@ | |||
"preview": "vite preview" | |||
}, | |||
"dependencies": { | |||
"react": "^18.0.0", | |||
"react-dom": "^18.0.0" |
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.
Intentionally removed to reproduce issue in End to End test.
Passing run #46257 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
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.
LGTM, just a couple minor suggestions - will approve assuming those are addressed one way or the other
packages/launchpad/cypress/e2e/scaffold-component-testing.cy.ts
Outdated
Show resolved
Hide resolved
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.
LGTM
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
We were caching the module resolution during the deps detection step, so even after installing a dep, we don't detect it - classic caching issue 🤦
Only an issue if a user is missing dependencies, which shouldn't be too common.
Steps to test
Repro in the original issue. I made a React/Vite project, removed
react-dom
, then proceeded to setup Cypress CT. react-dom was not detected. I didyarn add react-dom
in the project, and now it is correctly detected.How has the user experience changed?
Correctly detects newly added dependencies during onboarding and shows user.
PR Tasks
cypress-documentation
?type definitions
?