-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Specifying supportFile
in config doesn't work with node_modules
in path
#23616
Comments
supportFile
doesn't work with node_modules
in pathsupportFile
in config doesn't work with node_modules
in path
@drptbl The logic we have in place explicitly ignores content in In the mean time, can you create a project-specific support file that imports your shared support file? This should unblock you from upgrading to Cypress 10. |
@emilyrohrbough Thanks for answer and helping out with this issue 🙏. synpress is a tool built on top of cypress with shared config, so if I would use proposed workaround, everyone using synpress would have to add additional file to a project and then remove it after this issue is fixed. I want to make sure that there are no unnecessary breaking changes between updates for synpress users 🙇. |
@drptbl I totally understand. I doubt we will get this out as fast as you'd like if you are building on top of Cypress. 😕 Would you be interested in contributing a fix to support leveraging a supportFile located in |
Blocking us as well. Duplicating the support file to multiple apps' is a pretty painful workaround. I would much rather be able to reference it from node_modules. |
@scarsam Would you be interested in contributing this fix? |
We are also affected by this. What is the approach to share cypress commands then? |
any updates about this problem. It's blocking in my project and the issue has been opened 7 months ago. |
@zoltanbedi and @yduartep, the recommended approach to import a third party support file is to just directly import the file in your local support file:
// import your local commands
import './commands'
// import a third party support file
import 'package/path/to/support/file' |
@emilyrohrbough Hey :) I really stuck right now with this implementation for our projects. |
@idanElitzur, does the recommended approach posted above work for you? |
Thanks @mschile that worked for me! |
Ant news regarding this issue? |
I encountered the same problem when setting up a custom Cypress project as an npm package. When I try to run it with npx, the same error appears; I don't see any workaround. Has anyone here had a similar issue and managed to work around it? |
Chiming in to say this is also giving me problems (and took me a while to figure out why it stopped working when I made it into an npm package). Glad that qwazimoda has created a PR and hoping the cypress devs merge it in quickly. |
…28456) * FileDataSource: do not ignore node_modules if it is spicified by an user * extra empty commit * update changelog * update the changelog * add x.x.x version to the changelog * change version location in the changelog * provide an exact version and a release date, since it is checkec by regex in the parse-changelog.js * add unit tests * Fix changelog --------- Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com> Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
If
supportFile
is placed somewhere insidenode_modules
folder and then you define the path to it insidecypress.config.js
file, cypress won't be able to find it, no matter what. As soon as you move yoursupportFile
away fromnode_modules
folder and update the path incypress.config.js
file, everything works flawlessly.This issue is a blocker for updating synpress to Cypress@10.
Desired behavior
You should be able to define
supportFile
withnode_modules
in path.Test code to reproduce
Simply place your default
support
folder insidenode_modules
folder and update the path to it insidecypress.config.js
file. Then run your tests.Cypress Version
10.6.0
Node version
16.17.0
Operating System
macOS 12.3.1
Debug Logs
Other
cypress.config.js
The text was updated successfully, but these errors were encountered: