question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@cypress/vue TypeError: Cannot read property 'rules' of undefined during manual installation

See original GitHub issue

Current behavior

Following the manual-install guide for @cypress/vue package shows the following error when cypress open Screenshot 2021-02-08 at 17 09 37

Message: The function exported by the plugins file threw an error. We invoked the function exported by /Users/alvarosaburido/Projects/dav/digital.av.portal/cypress/plugins/index.js, but it threw an error. Details:

TypeError: Cannot read property 'rules' of undefined
    at insertBabelLoader (/Users/alvarosaburido/Projects/dav/digital.av.portal/node_modules/@cypress/vue/dist/preprocessor/webpack.js:111:20)
    at onFileDefaultPreprocessor (/Users/alvarosaburido/Projects/dav/digital.av.portal/node_modules/@cypress/vue/dist/preprocessor/webpack.js:137:5)
    at cypressPluginsFn (/Users/alvarosaburido/Projects/dav/digital.av.portal/node_modules/@cypress/vue/dist/plugins/webpack/index.js:20:29)
    at module.exports (/Users/alvarosaburido/Projects/dav/digital.av.portal/cypress/plugins/index.js:22:3)
    at /Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:89:12
    at tryCatcher (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)
    at load (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:86:7)
    at EventEmitter.<anonymous> (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:200:5)
    at EventEmitter.emit (events.js:315:20)
    at process.<anonymous> (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:19:22)
    at process.emit (events.js:315:20)
    at process.emit (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/source-map-support/source-map-support.js:495:21)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)

Stack trace:

Error: The function exported by the plugins file threw an error.
We invoked the function exported by `/Users/alvarosaburido/Projects/dav/digital.av.portal/cypress/plugins/index.js`, but it threw an error.
    at Object.get (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/errors.js:966:15)
    at EventEmitter.<anonymous> (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/index.js:144:21)
    at EventEmitter.emit (events.js:315:20)
    at ChildProcess.<anonymous> (/Users/alvarosaburido/Library/Caches/Cypress/6.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:19:22)
    at ChildProcess.emit (events.js:315:20)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)

Desired behavior

Cypress works correctly

Test code to reproduce

  1. Follow this guide https://github.com/cypress-io/cypress/blob/develop/npm/vue/docs/manual-install.md in a non-Vue-cli project.
  2. Command cypress open
  3. Check line 111 on node_modules/@cypress/vue/dist/preprocessor/webpack

Versions

"cypress": "^6.4.0"
"@cypress/vue": "^1.0.0-alpha.4",
"@cypress/webpack-preprocessor": "^4.1.0",

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JessicaSachscommented, Feb 10, 2021

This is a bug with our semantic release process. We didn’t promote the master tag to latest. Nice catch. For an immediate (very temp) fix you can npm i @cypress/vue@master to get around it and when we do our breaking changes and major version bump in a few days, we’ll be changing the latest tag to be 2.x

0reactions
alvarosabucommented, Feb 10, 2021

Awesome! Yeah, I also have issues sometimes with the semantic release hehe. Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress TypeError: Cannot read properties of undefined ...
The issue has nothing to do with the use or not of "uid" in you code. The issue is in the cucumber dependency...
Read more >
Changelog - Cypress Documentation
Cypress no longer throws the error "cannot read property split of undefined" in certain circumstances when application errors are thrown. Fixes #17378.
Read more >
Cypress - Cannot read property 'add' of undefined - Laracasts
Hi I'm new to testing with Cypress and wading my way through but have come across an error I can't seem to resolve....
Read more >
@cypress/vue - npm
Instead of running your tests in node (using Jest or Mocha), the Cypress Component Testing Library runs each component in the real browser...
Read more >
uncaught typeerror: cannot read properties of undefined ...
Store , you now use createStore to create the store object and no need to use Vue.use(Vuex) anymore in your store.js . import ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found