Can't run Cypress test because of plugins error - Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns
See original GitHub issueCurrent behavior
After we installed and configured Typescript to Cypress:
On open cypress and then starting a test, the browser opens and starts loading the test, but before the test actually starts, Cypress crashes and shows this error:
The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file (/Users/maaike/Projects/cypress/cypress/plugins/index.ts)
Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns'
Desired behavior
With our current configurations we expect Cypress with Typescript added to work. We followed the instructions, then cleared cache, reinstalled cypress, but nothing helps. We searched on the shown error but can’t find anything useful. That’s why we think there might be a bug here. I hope you can investigate it and find the cause
Test code to reproduce
tsconfig.json:
{
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"types": ["cypress", "node"],
"esModuleInterop": true,
"allowJs": true
},
"include": ["**/*.ts"]
}
cypress/plugins/index.ts:
// promisified fs module
import fs from 'fs-extra'
import path from 'path'
import webpack from '@cypress/webpack-preprocessor'
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve('cypress', 'config', `${file}.json`)
return fs.readJson(pathToConfigFile)
}
// plugins file
module.exports = (on, config) => {
require('cypress-terminal-report/src/installLogsPrinter')(on)
require('cypress-log-to-output').install(on, (type, event) => {
return (event.level === 'error' || event.type === 'error') && islogableError(event)
})
const options = {
// send in the options from your webpack.config.js, so it works the same
// as your app's code
webpackOptions: require('../../webpack.config'),
watchOptions: {},
}
on('file:preprocessor', webpack(options))
const environment = process.env.ENVIRONMENT || config.env.ENVIRONMENT || 'acceptance'
console.log(`plugins/index.ts: Loading local config from cypress/config/${environment}.json...`)
return getConfigurationByFile(environment)
}
webpack.config.js
const path = require('path')
module.exports = {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
}
Versions
Cypress 5.3.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:25 (4 by maintainers)
Top Results From Across the Web
Error: ENOENT: no such file or directory, stat '/.VolumeIcon ...
The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file ......
Read more >Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns'
The following error was thrown by a plugin. We stopped running your tests because a plugin crashed. Please check your plugins file ......
Read more >cypress-io/cypress - Gitter
Oops...we found an error preparing this test file: cypress/support/index.js The error was: Error: ENOENT: no such file or directory, stat ...
Read more >Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns'
Coding example for the question Error: ENOENT: no such file or directory, stat '/.VolumeIcon.icns'-Vue.js.
Read more >Error: ENOENT: no such file or directory, scandir ... - YouTube
nodejsError: ENOENT : no such file or directory, scandir '**/node_modules/node-sass/vendor' | Module build failed (from .
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
The solution to this issue is seriously to run
sudo touch /.VolumeIcon.icns?What is causing this though?