cypress: Cypress Object.statSync Error (Cannot read properties of undefined (reading 'uid'))
Current behavior
Today
Notes:
- Tried reinstalling cypress
- Tried clearing cypress cache
- Tried a new version of Cypress
- Remove the node_modules folder & package-lock file from the repo
- npm i
- ‘npx cypress open’
- Click on a spec/feature file
- The runner output the following
TypeError: Cannot read properties of undefined (reading 'uid') at Object.statSync (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\node_modules\graceful-fs\polyfills.js:303:17) at isDirectory (C:\Users\User\Documents\ADO\Nebula\Policy\tests\CypressTests\node_modules\resolve\lib\sync.js:22:23) at loadNodeModulesSync (C:\Users\User\Documents\ADO\Nebula\Policy\tests\CypressTests\node_modules\resolve\lib\sync.js:191:17) at Function.resolveSync [as sync] (C:\Users\User\Documents\ADO\Nebula\Policy\tests\CypressTests\node_modules\resolve\lib\sync.js:98:17) at Object.handler (C:\Users\User\Documents\ADO\Nebula\Policy\tests\CypressTests\cypress\plugins\index.js:13:27) at invoke (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js:22:16) at C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\util.js:45:14 at tryCatcher (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23) at Function.Promise.attempt.Promise.try (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\method.js:39:29) at Object.wrapChildPromise (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\util.js:44:23) at Object.wrap (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\child\preprocessor.js:28:8) at execute (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js:119:27) at EventEmitter.<anonymous> (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\child\run_plugins.js:202:5) at EventEmitter.emit (events.js:376:20) at process.<anonymous> (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\lib\plugins\util.js:19:22) at process.emit (events.js:376:20) at process.emit (C:\Users\User\AppData\Local\Cypress\Cache\8.7.0\Cypress\resources\app\packages\server\node_modules\source-map-support\source-map-support.js:495:21) at emit (internal/child_process.js:910:12) at processTicksAndRejections (internal/process/task_queues.js:83:21)
Desired behavior
This obviously should not be happening
Test code to reproduce
Steps to reproduce described already
Cypress Version
8.7.0
Other
I see this issue with 8.7.0 & also 9.2.1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 15 (5 by maintainers)
Yes! Thank you. It was something completely different, but in the end - my problem. Thanks for the help!
Any work-around for vue + vite, yet?
Should this really be closed, just because there is a work-around?
Doc in the cucumber repo changed. Changing my former code with the documented one solved it for me. I changed path.resolve(‘…’) by path.resolve(‘.’) because it suitted better my situation.
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor#with-out-of-the-box-support
Hope it helps.
Hi,
We have resolved the issue on our side. There were conflicts with Typescript, cypress-cucumber-preprocessor & Cypress Tags.
const cucumber = require(“cypress-cucumber-preprocessor”).default; const browserify = require(“@cypress/browserify-preprocessor”); const tagify = require(“cypress-tags”);
module.exports = (on, config) => { const options = { …browserify.defaultOptions, typescript: require.resolve(“typescript”) };
};
“@cypress/browserify-preprocessor”: “^3.0.2”, “@testing-library/cypress”: “^8.0.2”, “@types/cypress-cucumber-preprocessor”: “4.0.1”, “@types/uuid”: “^8.3.1”, “cypress”: “^9.2.1”, “cypress-cucumber-preprocessor”: “^4.3.1”, “cypress-tags”: “^0.3.0”, “cypress-xpath”: “^1.6.2”,
Aidan