Description
Current behavior
When doing the onboarding for CT, sometimes it claims you are missing a dependency, when you are not. Eg in this example I have both Solid.js and Vite Plugin Solid, but it says I don't:
Problem is here: https://github.com/cypress-io/cypress/blob/develop/packages/scaffold-config/src/frameworks.ts#L26-L28
Error:
cypress:scaffold-config:frameworks error when detecting solid-js: Package subpath './package.json' is not defined by "exports" in /Users/lachlanmiller/code/dump/my-solid-app/node_modules/solid-js/package.json
While it is possible to fix, eg like this, we need to have an alternative strategy that does not rely on package.json
getting added to the export map for every module on npm.
Desired behavior
Correctly find and determine the module and version.
Test code to reproduce
The easiest way to reproduce would be
yarn create vite my-app --template react
cd
into node_modules/react
, remove package.json
from the exports
key in package.json
.
Do the Cypress setup and observe it does not detect that you have React installed.
Cypress Version
12
Node version
16
Operating System
Linux, macos
Debug Logs
cypress:scaffold-config:frameworks error when detecting solid-js: Package subpath './package.json' is not defined by "exports" in /Users/lachlanmiller/code/dump/my-solid-app/node_modules/solid-js/package.json
### Other
_No response_