lmiller1990 / cypress-react-template

Component Testing with Cypress and React
15 stars 12 forks source link

PLUGINS_FUNCTION_ERROR: TypeError: Cannot destructure property 'webpackConfigPath' of 'undefined' as it is undefined.\n #7

Closed gDev95 closed 3 years ago

gDev95 commented 3 years ago

Its worth mentioning that I have a new Macbook with the M1 chip node: 16.1.0

Steps to Reproduce

Opening Cypress...
[ 8, 16 ]
Error: The function exported by the plugins file threw an error.

We invoked the function exported by `/Users/111216929093406285161/cypress-react-template/cypress/plugins/index.js`, but it threw an error.
    at Object.get (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/errors.js:988:15)
    at EventEmitter.<anonymous> (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/index.js:160:21)
    at EventEmitter.emit (events.js:315:20)
    at ChildProcess.<anonymous> (/Users/111216929093406285161/Library/Caches/Cypress/7.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:903:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
 {
  isCypressErr: true,
  type: 'PLUGINS_FUNCTION_ERROR',
  details: "TypeError: Cannot destructure property 'webpackConfigPath' of 'undefined' as it is undefined.\n" +
    '    at findReactScriptsWebpackConfig (/Users/111216929093406285161/cypress-react-template/node_modules/@cypress/react/plugins/react-scripts/findReactScriptsWebpackConfig.js:9:68)\n' +
    '    at module.exports (/Users/111216929093406285161/cypress-react-template/cypress/plugins/index.js:9:25)\n' +
    '    at /Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:90:12\n' +
    '    at tryCatcher (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)\n' +
    '    at Function.Promise.attempt.Promise.try (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/method.js:39:29)\n' +
    '    at load (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:87:7)\n' +
    '    at EventEmitter.<anonymous> (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:198:5)\n' +
    '    at EventEmitter.emit (events.js:315:20)\n' +
    '    at process.<anonymous> (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:19:22)\n' +
    '    at process.emit (events.js:315:20)\n' +
    '    at process.emit (/Users/111216929093406285161/Library/Caches/Cypress/7.4.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/source-map-support/source-map-support.js:495:21)\n' +
    '    at emit (internal/child_process.js:903:12)\n' +
    '    at processTicksAndRejections (internal/process/task_queues.js:81:21)'
}
Error: The function exported by the plugins file threw an error.
lmiller1990 commented 3 years ago

I had this too. I just updated @cypress/react and cypress to the latest version and it's okay now. Please try updating your dependencies.