Closed
Description
Message: The pluginsFile
must export a function.
We loaded the pluginsFile
from: /Users/xinyi/Documents/X/Xinyi/event-calendar-app/cypress/plugins/index.js
It exported:
Details: {}
Stack trace:
[object Object]
at Object.get (/Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/server/lib/errors.js:344:11)
at EventEmitter.<anonymous> (/Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/index.js:105:21)
at EventEmitter.emit (events.js:203:13)
at ChildProcess.<anonymous> (/Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:25:29)
at ChildProcess.emit (events.js:203:13)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
From previous event:
at fn (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:88596:14)
at ipcBus (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:88614:10)
at Object.ipc.<computed> [as openProject] (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:88655:69)
at openProject (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:91044:67)
at file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:91063:12
From previous event:
at Object.reopenProject (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:91062:32)
at Project._this._reopenProject (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:90605:78)
at Object.ka (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63367:205)
at qa (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63367:359)
at ra (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63368:35)
at wa (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63368:236)
at Aa (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63369:248)
at ya (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63369:57)
at Ba (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63369:412)
at Kd (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63433:493)
at hb (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63637:185)
at Qd (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63435:253)
at Hc (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63436:470)
at Pd (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63436:98)
at ../../node_modules/scheduler/cjs/scheduler.production.min.js.exports.unstable_runWithPriority (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:73703:437)
at fg (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63472:325)
at fb (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63637:46)
at Nd (file:///Users/xinyi/Library/Caches/Cypress/4.1.0/Cypress.app/Contents/Resources/app/packages/desktop-gui/dist/app.js:63434:277)
Activity
jennifer-shehane commentedon Mar 2, 2020
@xxinyiwho Can you provide the code in your
plugings/index.js
? (Feel free to remove any sensitive info)The
plugins/index.js
file will technically export whatever you tell it to export, but there could be a bug with the usage depending on what we see from your file.xxinyiwho commentedon Mar 2, 2020
@jennifer-shehane thanks for your quick reply!! I havent change anything in the index file, please see the following:
jennifer-shehane commentedon Mar 3, 2020
Hey @xxinyiwho, you have changed the content from the originally seeded
plugins/index.js
file. Theplugins/index.js
file requires that you export the function below code at a minimum to work within Cypress, which you have commented out.I do however feel that this error could maybe be improved, so will keep this issue open to improve this error message.
Current error if
plugins/index.js
file is blankCode for error message: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/errors.coffee#L589:L589
The error message should at the least link to https://on.cypress.io/writing-a-plugin
[-]PLUGIN INDEX FILE EXPORTING OBJECT INSTEAD OF FUNCTION[/-][+]When `plugins/index.js` file is left blank, need more descriptive error on what to export[/+]xxinyiwho commentedon Mar 4, 2020
Hi Jennifer, I tried to remove the comment too still didnt work. in the end I uninstalled it and reinstalled again but with react test config. Thank you for your answers
pluginsFile
does not export a function #73813 remaining items
cypress-bot commentedon May 26, 2020
The code for this is done in cypress-io/cypress#7381, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
cypress-bot commentedon May 26, 2020
Released in
4.7.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.7.0, please open a new issue.