Your pluginsFile is set to /test/cypress/plugins/index.js, but either the file is missing, it contains a syntax error, or threw an error when required.
See original GitHub issueSoftware version
OS: Ubuntu 20.04 Node: 12 NPM: w/ 12 Any other software related to your bug:
What did you get as the error?
I got this in the Cypress UI:
**Message:** The plugins file is missing or invalid.
Your `pluginsFile` is set to `/home/michael/dramawithfriends/www/test/cypress/plugins/index.js`, but either the file is missing, it contains a syntax error, or threw an error when required. The `pluginsFile` must be a `.js`, `.ts`, or `.coffee` file.
Or you might have renamed the extension of your `pluginsFile`. If that's the case, restart the test runner.
Please fix this, or set `pluginsFile` to `false` if a plugins file is not necessary for your project.
**Details:** /home/michael/dramawithfriends/www/test/cypress/plugins/index.js:21
export default pluginConfig;
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1051:16)
at Module._compile (internal/modules/cjs/loader.js:1101:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166:10)
at Module.load (internal/modules/cjs/loader.js:981:32)
at Module._load (internal/modules/cjs/loader.js:881:14)
at Function.Module._load (electron/js2c/asar.js:769:28)
at Module.require (internal/modules/cjs/loader.js:1023:19)
at require (internal/modules/cjs/helpers.js:77:18)
at runPlugins (/home/michael/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/child/run_plugins.js:213:15)
at Object.<anonymous> (/home/michael/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/child/index.js:8:25)
at Module._compile (internal/modules/cjs/loader.js:1145:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166:10)
at Module.load (internal/modules/cjs/loader.js:981:32)
at Module._load (internal/modules/cjs/loader.js:881:14)
at Function.Module._load (electron/js2c/asar.js:769:28)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
**Stack trace:**
Error: The plugins file is missing or invalid.
Your `pluginsFile` is set to `/home/michael/dramawithfriends/www/test/cypress/plugins/index.js`, but either the file is missing, it contains a syntax error, or threw an error when required. The `pluginsFile` must be a `.js`, `.ts`, or `.coffee` file.
Or you might have renamed the extension of your `pluginsFile`. If that's the case, restart the test runner.
Please fix this, or set `pluginsFile` to `false` if a plugins file is not necessary for your project.
at Object.get (/home/michael/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/errors.js:968:15)
at EventEmitter.<anonymous> (/home/michael/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/index.js:144:21)
at EventEmitter.emit (events.js:310:20)
at ChildProcess.<anonymous> (/home/michael/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)
at ChildProcess.emit (events.js:310:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
The file is there, and says SyntaxError: Unexpected token ‘export’:
node /home/michael/dramawithfriends/www/test/cypress/plugins/index.js
(node:25767) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
/home/michael/dramawithfriends/www/test/cypress/plugins/index.js:21
export default pluginConfig;
^^^^^^
SyntaxError: Unexpected token 'export'
What were you expecting?
Tests to run.
What steps did you take, to get the error?
EDIT: This wasn’t clear.
- Installed the testing harness
$ quasar ext add @quasar/testing
- ran
quasar test:e2e
- got the error above
- Added babel:
yarn add @babel/core @babel/cli
- Tried again with this error:
This dependency was not found:
* /home/michael/dramawithfriends/www/.quasar/client-entry.js in multi (webpack)-dev-server/client?http://0.0.0.0:8080 (webpack)/hot/dev-server.js ./.quasar/client-entry.js
To install it, you can run: npm install --save /home/michael/dramawithfriends/www/.quasar/client-entry.js
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Cypress Task: The plugins file is missing or invalid
I got the same error, I had forgotten to execute the following code: npm install --save-dev cypress-cucumber-preprocessor.
Read more >cypress-io/cypress - Gitter
web/test/cypress/plugins/index.js, but either the file is missing, it contains a syntax error, or threw an error when required. The pluginsFile must be a ......
Read more >learning-cypress-part-1-notes.txt - Tumblr
Your pluginsFile is set to 'D:\wamp64\www\collapo\cypress\plugins\index.js', but either the file is missing, it contains a syntax error, or threw an error ...
Read more >Migration Guide | Cypress Documentation
The .should() assertion now throws an error if Cypress commands are ... plugins file, but you will need to load that file explicitly, ......
Read more >How to Fix the Syntax Error in WordPress - WPBeginner
There are so many WordPress tutorials that require you to add code snippets to your website. Unfortunately, a small little error can cause ......
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 Free
Top 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
Fixed in https://github.com/quasarframework/quasar-testing/commit/eb14b2de0cff5bbcb5144990cfa3d5d40b1bbe80 v2.0.4 released with the fix
Seems like that’s the only file not transpiled, and a community PR some times ago wrongly used ES5 import/export syntax. I reverted to the normal Node syntax and now it should work
Brings me back to the original error.