Module not found: Error: Can't resolve '@cypress/xpath'
See original GitHub issueCurrent behavior
Followed instructions for installing @cypress/xpath
included require('@cypress/xpath')
in support file. Encountered error running tests in Electron (but browser isnt really relevent):
Error: Webpack Compilation Error
Module not found: Error: Can't resolve '@cypress/xpath'
Desired behavior
Update package.json in @cypress/xpath to export correctly
Test code to reproduce
- npm install -D @cypress/xpath
- add
require('@cypress/xpath');
to support file - run tests
Cypress Version
10.6.0
Node version
v16.14.0
Operating System
macOS 12.6
Debug Logs
No response
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:15 (1 by maintainers)
Top Results From Across the Web
How to resolve cypress error when installing first time
Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js you have to add this: require('cypress-xpath');.
Read more >cypress-xpath - npm
Adds XPath command to Cypress test runner. ... Start using cypress-xpath in your project by running `npm i cypress-xpath`.
Read more >cypress-xpath - npm Package Health Analysis - Snyk
The npm package cypress-xpath was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >Module not found: Error: Can't resolve 'cypress-file-upload' in ...
I use a npm package called 'cypress-file-upload' and import it in the index. js file within cypress/support. In the bitbucket-pipelines.
Read more >How to install Xpath plugin in Cypress : Tutorial 4 - YouTube
This video contains how to install xpath plugin in Cypress.You can follow me on Facebook ... Your browser can't play this video.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also facing the same issue, following steps in readme
I was able to resolve the issue by:
ran command npm install -D cypress-xpath
in the folder cypress/support/e2e at the top of the file typed require(‘cypress-xpath’);
and at the cypress/e2e in my test at the top I placed the following command /// <reference types="cypress-xpath" />