I have created a new React project using
npx create-react-app virtual-office
I then installed a few things like styled-components, react-test-library etc
I then installed cypress with
yarn add -D cypress
When I try running cypress from the project directory with the command
./node_modules/.bin/cypress open
The cypress window opens but the spinner stays up and doesn't load any further.
Running cypress with the debugger turned on it looks like it can find the browser (see the end of the question for the output of the debugger). If I run cypress with the following command I get the same error
yarn run cypress open -b /usr/local/bin/chromium
I can open the Chromium browser with the command
/usr/local/bin/chromium
The version of Chromium is 81.0.4044.92
The command ls -la /usr/local/bin/c* gives the result
lrwxrwxrwx 2 root root 13 Apr 16 10:45 /usr/local/bin/chromium -> /usr/bin/snap
I have also run the commands
node_modules/.bin/cypress cache clear
node_modules/.bin/cypress install
node_modules/.bin/cypress open
And I get the same issue, the Cypress window opens, but no content loads.
What am I doing wrong?
Here are the logs from running the command
DEBUG=cypress:* yarn run cypress open -b /usr/local/bin/chromium &> cypress.log
yarn run v1.21.1
$ /home/luke/projects/virtual-office/node_modules/.bin/cypress open -b /usr/local/bin/chromium
2020-04-16T13:23:16.050Z cypress:cli:cli cli starts with arguments ["/usr/bin/node","/home/luke/projects/virtual-office/node_modules/.bin/cypress","open","-b","/usr/local/bin/chromium"]
2020-04-16T13:23:16.051Z cypress:cli NODE_OPTIONS is not set
2020-04-16T13:23:16.052Z cypress:cli:cli program parsing arguments
2020-04-16T13:23:16.052Z cypress:cli:cli opening Cypress
2020-04-16T13:23:16.149Z cypress:cli parsed cli options { browser: '/usr/local/bin/chromium' }
2020-04-16T13:23:16.149Z cypress:cli opening from options {"browser":"/usr/local/bin/chromium","project":"/home/luke/projects/virtual-office"}
2020-04-16T13:23:16.149Z cypress:cli command line arguments ["--browser","/usr/local/bin/chromium","--project","/home/luke/projects/virtual-office"]
2020-04-16T13:23:16.149Z cypress:cli verifying Cypress app
2020-04-16T13:23:16.150Z cypress:cli checking environment variables
2020-04-16T13:23:16.153Z cypress:cli checking if executable exists /home/luke/.cache/Cypress/4.4.0/Cypress/Cypress
2020-04-16T13:23:16.154Z cypress:cli Binary is executable? : true
2020-04-16T13:23:16.155Z cypress:cli binaryDir is /home/luke/.cache/Cypress/4.4.0/Cypress
2020-04-16T13:23:16.155Z cypress:cli Reading binary package.json from: /home/luke/.cache/Cypress/4.4.0/Cypress/resources/app/package.json
2020-04-16T13:23:16.163Z cypress:cli Found binary version 4.4.0 installed in: /home/luke/.cache/Cypress/4.4.0/Cypress
2020-04-16T13:23:16.166Z cypress:cli { verified: true }
2020-04-16T13:23:16.166Z cypress:cli is Verified ? true
2020-04-16T13:23:16.167Z cypress:cli DISPLAY environment variable is set to :1 on Linux
Assuming this DISPLAY points at working X11 server,
Cypress will not spawn own Xvfb
NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
see https://github.com/cypress-io/cypress/issues/4034
Solution: Unset the DISPLAY variable and try again:
DISPLAY= npx cypress run ...
2020-04-16T13:23:16.168Z cypress:cli needs to start own Xvfb? false
2020-04-16T13:23:16.169Z cypress:cli spawning, should retry on display problem? true
2020-04-16T13:23:16.176Z cypress:cli passing DISPLAY :1
2020-04-16T13:23:16.176Z cypress:cli spawning Cypress with executable: /home/luke/.cache/Cypress/4.4.0/Cypress/Cypress
2020-04-16T13:23:16.177Z cypress:cli spawn args [ '--no-sandbox', '--', '--browser', '/usr/local/bin/chromium', '--project', '/home/luke/projects/virtual-office', '--cwd', '/home/luke/projects/virtual-office' ] { detached: false, stdio: 'inherit' }
2020-04-16T13:23:16.368Z cypress:ts Running without ts-node hook in environment "production"
2020-04-16T13:23:16.798Z cypress:server:appdata path: /home/luke/.config/Cypress/cy/production/browsers
2020-04-16T13:23:16.800Z cypress:server:util:node_options NODE_OPTIONS check passed, not forking { NODE_OPTIONS: '--max-http-header-size=1048576 --http-parser=legacy' }
2020-04-16T13:23:16.800Z cypress:server:util:node_options restoring NODE_OPTIONS { NODE_OPTIONS: '--max-http-header-size=1048576 --http-parser=legacy', ORIGINAL_NODE_OPTIONS: undefined }
2020-04-16T13:23:16.989Z cypress:server:cypress starting cypress with argv [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress', '--no-sandbox', '--', '--browser', '/usr/local/bin/chromium', '--project', '/home/luke/projects/virtual-office', '--cwd', '/home/luke/projects/virtual-office' ]
2020-04-16T13:23:16.989Z cypress:server:args argv array: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress', '--no-sandbox', '--browser', '/usr/local/bin/chromium', '--project', '/home/luke/projects/virtual-office', '--cwd', '/home/luke/projects/virtual-office' ]
2020-04-16T13:23:16.992Z cypress:server:args argv parsed: { _: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress' ], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true }
2020-04-16T13:23:16.992Z cypress:server:util:proxy found proxy environment variables {}
2020-04-16T13:23:16.992Z cypress:server:args options { _: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress' ], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {} }
2020-04-16T13:23:16.992Z cypress:server:args argv options: { _: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress' ], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {}, projectRoot: '/home/luke/projects/virtual-office' }
2020-04-16T13:23:16.992Z cypress:server:cypress from argv [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress', '--no-sandbox', '--browser', '/usr/local/bin/chromium', '--project', '/home/luke/projects/virtual-office', '--cwd', '/home/luke/projects/virtual-office' ] got options { _: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress' ], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {}, projectRoot: '/home/luke/projects/virtual-office' }
2020-04-16T13:23:17.032Z cypress:server:appdata path: /home/luke/.config/Cypress/cy/production
2020-04-16T13:23:17.074Z cypress:server:cypress starting in mode interactive with options { _: [ '/home/luke/.cache/Cypress/4.4.0/Cypress/Cypress' ], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {}, projectRoot: '/home/luke/projects/virtual-office' }
2020-04-16T13:23:17.076Z cypress:server:cypress running Electron currently
2020-04-16T13:23:17.122Z cypress:server:appdata path: /home/luke/.config/Cypress/cy/production
2020-04-16T13:23:17.420Z cypress:server:appdata path: /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:18.907Z cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
┌─────────┬───────────────────┬──────────────┬────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
│ (index) │ group │ processCount │ pids │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
├─────────┼───────────────────┼──────────────┼────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
│ 0 │ 'cypress' │ 1 │ '31795' │ 0 │ 0 │ 147.84 │ 147.84 │ 147.84 │
│ 1 │ 'electron-shared' │ 1 │ '31797' │ 0 │ 0 │ 42.06 │ 42.06 │ 42.06 │
│ 2 │ 'other' │ 2 │ '31939, 31940' │ 0 │ 0 │ 3.72 │ 3.72 │ 3.72 │
│ 3 │ 'TOTAL' │ 4 │ '-' │ 0 │ 0 │ 193.63 │ 193.63 │ 193.63 │
└─────────┴───────────────────┴──────────────┴────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘
2020-04-16T13:23:19.174Z cypress:server:saved_state making saved state from /home/luke/.cache/Cypress/4.4.0/Cypress/resources/app/packages/server
2020-04-16T13:23:19.174Z cypress:server:saved_state for project path /home/luke/projects/virtual-office
2020-04-16T13:23:19.176Z cypress:server:saved_state state path for project /home/luke/projects/virtual-office
2020-04-16T13:23:19.178Z cypress:server:appdata path: /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.178Z cypress:server:saved_state full state path /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.179Z cypress:server:saved_state making new state file around /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.180Z cypress:server:file get values from /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.182Z cypress:server:file attempt to get lock on /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.187Z cypress:server:file gettin lock succeeded or failed for /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.188Z cypress:server:file read /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.193Z cypress:server:file read succeeded or failed for /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.193Z cypress:server:file attempt to unlock /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.195Z cypress:server:file unlock succeeded or failed for /home/luke/.config/Cypress/cy/production/projects/virtual-office-c3059dc18bc433707ce1e3eabd199225/state.json
2020-04-16T13:23:19.220Z cypress:server:windows creating electron window with options { backgroundColor: '#dfe2e4', width: 801, height: 550, minWidth: 458, minHeight: 400, x: 107, y: 214, type: 'INDEX', devTools: false, trackState: { width: 'appWidth', height: 'appHeight', x: 'appX', y: 'appY', devTools: 'isAppDevToolsOpen' }, onBlur: [Function: onBlur], onFocus: [Function: onFocus], onClose: [Function: onClose], show: true, frame: true, transparent: false, icon: NativeImage {}, webPreferences: { preload: '/home/luke/.cache/Cypress/4.4.0/Cypress/resources/app/packages/server/lib/ipc/ipc.js', partition: null, webSecurity: false, nodeIntegration: false, backgroundThrottling: false, backgroundColor: '#dfe2e4', transparent: false }, url: 'file:///home/luke/.cache/Cypress/4.4.0/Cypress/resources/app/packages/desktop-gui/dist/index.html', contextMenu: false, recordFrameRate: null, onCrashed: [Function: onCrashed], onNewWindow: [Function: onNewWindow] }
2020-04-16T13:23:19.678Z cypress:server:events got request for event: on:menu:clicked, undefined
2020-04-16T13:23:19.679Z cypress:server:events got request for event: get:options, undefined
2020-04-16T13:23:19.681Z cypress:server:events got request for event: get:current:user, undefined
2020-04-16T13:23:19.688Z cypress:server:file get values from /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.688Z cypress:server:file attempt to get lock on /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.694Z cypress:server:events sending ipc data { type: 'get:options', data: { id: 0.39036739440056767, data: { _: [Array], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {}, projectRoot: '/home/luke/projects/virtual-office', onFocusTests: null, os: 'linux', version: '4.4.0' } }, originalData: { id: 0.39036739440056767, data: { _: [Array], sandbox: false, browser: '/usr/local/bin/chromium', project: '/home/luke/projects/virtual-office', cwd: '/home/luke/projects/virtual-office', invokedFromCli: true, config: {}, projectRoot: '/home/luke/projects/virtual-office', onFocusTests: [Function: onFocusTests], os: 'linux', version: '4.4.0' } } }
2020-04-16T13:23:19.696Z cypress:server:file gettin lock succeeded or failed for /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.696Z cypress:server:file read /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.698Z cypress:server:file read succeeded or failed for /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.698Z cypress:server:file attempt to unlock /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.698Z cypress:server:file unlock succeeded or failed for /home/luke/.config/Cypress/cy/production/cache
2020-04-16T13:23:19.699Z cypress:server:events sending ipc data { type: 'get:current:user', data: { id: 0.3728344423972798, data: {} }, originalData: { id: 0.3728344423972798, data: {} } }
2020-04-16T13:23:19.717Z cypress:server:events got request for event: on:focus:tests, undefined
2020-04-16T13:23:19.718Z cypress:server:events got request for event: on:spec:changed, undefined
2020-04-16T13:23:19.718Z cypress:server:events got request for event: on:config:changed, undefined
2020-04-16T13:23:19.718Z cypress:server:events got request for event: on:project:error, undefined
2020-04-16T13:23:19.719Z cypress:server:events got request for event: on:project:warning, undefined
2020-04-16T13:23:19.719Z cypress:server:events got request for event: open:project, '/home/luke/projects/virtual-office'
2020-04-16T13:23:19.719Z cypress:server:events open:project
2020-04-16T13:23:19.720Z cypress:server:browsers getAllBrowsersWith { nameOrPath: '/usr/local/bin/chromium' }
2020-04-16T13:23:19.720Z cypress:server:browsers:utils getBrowsers
2020-04-16T13:23:19.723Z cypress:launcher detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, profile: true, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ] }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, profile: true, binary: [ 'chromium-browser', 'chromium' ] }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, profile: true, binary: 'google-chrome-canary' }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, profile: true, binary: 'firefox' }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, profile: true, binary: [ 'firefox-developer-edition', 'firefox' ] }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, profile: true, binary: [ 'firefox-nightly', 'firefox-trunk' ] }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/m, profile: true, binary: 'edge' }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, profile: true, binary: 'edge-canary' }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, profile: true, binary: 'edge-beta' }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, profile: true, binary: 'edge-dev' } ]
2020-04-16T13:23:19.732Z cypress:launcher checking one browser chrome
2020-04-16T13:23:19.732Z cypress:launcher looking up chrome on linux platform
2020-04-16T13:23:19.732Z cypress:launcher finding version string using command "google-chrome --version"
2020-04-16T13:23:19.750Z cypress:launcher checking one browser chrome
2020-04-16T13:23:19.750Z cypress:launcher looking up chrome on linux platform
2020-04-16T13:23:19.750Z cypress:launcher finding version string using command "chrome --version"
2020-04-16T13:23:19.772Z cypress:launcher checking one browser chrome
2020-04-16T13:23:19.772Z cypress:launcher looking up chrome on linux platform
2020-04-16T13:23:19.772Z cypress:launcher finding version string using command "google-chrome-stable --version"
2020-04-16T13:23:19.785Z cypress:server:events got request for event: updater:check, undefined
2020-04-16T13:23:19.786Z cypress:server:updater checking for new version of Cypress. current version is 4.4.0
2020-04-16T13:23:19.811Z cypress:launcher Received error detecting browser binary: "google-chrome-stable" with error: Command failed with ENOENT: google-chrome-stable --version
spawn google-chrome-stable ENOENT
2020-04-16T13:23:19.811Z cypress:launcher Received error detecting browser binary: "chrome" with error: Command failed with ENOENT: chrome --version
spawn chrome ENOENT
2020-04-16T13:23:19.811Z cypress:launcher Received error detecting browser binary: "google-chrome" with error: Command failed with ENOENT: google-chrome --version
spawn google-chrome ENOENT
2020-04-16T13:23:19.811Z cypress:launcher browser chrome not installed
2020-04-16T13:23:19.811Z cypress:launcher browser chrome not installed
2020-04-16T13:23:19.811Z cypress:launcher browser chrome not installed
2020-04-16T13:23:19.813Z cypress:launcher checking one browser chromium
2020-04-16T13:23:19.813Z cypress:launcher looking up chromium on linux platform
2020-04-16T13:23:19.813Z cypress:launcher finding version string using command "chromium-browser --version"
2020-04-16T13:23:19.835Z cypress:launcher checking one browser chromium
2020-04-16T13:23:19.835Z cypress:launcher looking up chromium on linux platform
2020-04-16T13:23:19.835Z cypress:launcher finding version string using command "chromium --version"
2020-04-16T13:23:19.858Z cypress:network:agent addRequest called { isHttps: true, href: 'https://download.cypress.io/desktop.json' }
2020-04-16T13:23:19.863Z cypress:network:connect beginning getAddress { hostname: 'download.cypress.io', port: 443 }
2020-04-16T13:23:19.872Z cypress:launcher Received error detecting browser binary: "chromium-browser" with error: Command failed with ENOENT: chromium-browser --version
spawn chromium-browser ENOENT
2020-04-16T13:23:19.873Z cypress:launcher browser chromium not installed
2020-04-16T13:23:19.874Z cypress:network:connect got addresses { hostname: 'download.cypress.io', port: 443, addresses: [ { address: '104.26.7.176', family: 4 }, { address: '104.26.6.176', family: 4 }, { address: '2606:4700:20::681a:7b0', family: 6 }, { address: '2606:4700:20::681a:6b0', family: 6 } ] }
2020-04-16T13:23:19.902Z cypress:network:agent got family { family: 6, href: 'https://download.cypress.io/desktop.json' }
2020-04-16T13:23:20.631Z cypress:server:updater latest version of Cypress is: 4.4.0
2020-04-16T13:23:20.631Z cypress:server:updater new version of Cypress does not exist
2020-04-16T13:23:20.632Z cypress:server:events sending ipc data { type: 'updater:check', data: { id: 0.23731125038707646, data: false }, originalData: { id: 0.23731125038707646, data: false } }
2020-04-16T13:23:30.159Z cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
┌─────────┬───────────────────┬──────────────┬───────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
│ (index) │ group │ processCount │ pids │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
├─────────┼───────────────────┼──────────────┼───────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
│ 0 │ 'cypress' │ 1 │ '31795' │ 1.23 │ 0.61 │ 235.24 │ 191.54 │ 235.24 │
│ 1 │ 'electron-shared' │ 3 │ '31797, 31953, 32245' │ 0 │ 0 │ 166.46 │ 104.26 │ 166.46 │
│ 2 │ 'desktop-gui' │ 1 │ '32561' │ 0 │ 0 │ 121.11 │ 121.11 │ 121.11 │
│ 3 │ 'other' │ 2 │ '32739, 32740' │ 0 │ 0 │ 3.57 │ 3.64 │ 3.72 │
│ 4 │ 'TOTAL' │ 7 │ '-' │ 1.23 │ 0.61 │ 526.38 │ 360.01 │ 526.38 │
└─────────┴───────────────────┴──────────────┴───────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘
2020-04-16T13:23:41.003Z cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
┌─────────┬───────────────────┬──────────────┬───────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
│ (index) │ group │ processCount │ pids │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
├─────────┼───────────────────┼──────────────┼───────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
│ 0 │ 'cypress' │ 1 │ '31795' │ 1.17 │ 0.8 │ 238.16 │ 207.08 │ 238.16 │
│ 1 │ 'electron-shared' │ 3 │ '31797, 31953, 32245' │ 0.61 │ 0.2 │ 166.46 │ 124.99 │ 166.46 │
│ 2 │ 'desktop-gui' │ 1 │ '32561' │ 0.89 │ 0.44 │ 114.76 │ 117.94 │ 121.11 │
│ 3 │ 'other' │ 2 │ '912, 927' │ 0 │ 0 │ 3.63 │ 3.64 │ 3.72 │
│ 4 │ 'TOTAL' │ 7 │ '-' │ 2.66 │ 1.3 │ 523.01 │ 414.34 │ 526.38 │
└─────────┴───────────────────┴──────────────┴───────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘
[31953:0416/232558.016581:WARNING:x11_util.cc(1443)] X error received: serial 9721, error_code 9 (BadDrawable (invalid Pixmap or Window parameter)), request_code 130, minor_code 3 (X_ShmPutImage)
[31953:0416/232558.032148:WARNING:x11_util.cc(1443)] X error received: serial 9726, error_code 9 (BadDrawable (invalid Pixmap or Window parameter)), request_code 130, minor_code 3 (X_ShmPutImage)
This is an issue with Cypress on Ubuntu when Chromium is installed via snap as documented here: https://github.com/cypress-io/cypress/issues/7020
There will be a release of Cypress in the future to address the issue, so watch the GitHub issue for any updates.
Workaround:
Install Chromium via apt instead (apt install chromium-browser)
Current answer
The problem is solved in Cypress 4.4.1, so if possible, just upgrade. Otherwise see the old answers
Old answers
It is an issue using chromium installed via snap on ubuntu: https://github.com/cypress-io/cypress/issues/7020
According to the issue this bug has been patched, so it should be fixed from the next Cypress release, so hopefully this will be over from 4.4.1.
Workaround that doesn't require changes in packages:
Change the path for the command until the patch is on npm:
For fish shells:
env PATH="/home/rohdef/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin /usr/bin:/sbin:/bin" nom run ...
for bash and similar:
PATH="/home/rohdef/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin /usr/bin:/sbin:/bin" npm run ...
Make sure to adjust the path for your system, so start by doing echo $PATH and ensure that you don't leave important things out, and make sure not to have /snap/bin in your path
Workaround by installing Chromium via apt (doesn't work in 19.10)
This only works on older than 19.10, since in 19.10 apt just installs Chromium using snap
sudo snap remove chromium
sudo apt install chromium-browser
Workaround using this PPA: https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev I have not tested it yet
Workaround by upgrading chromium (sporadic success)
$ sudo snap save chromium # optional, backup
$ sudo snap switch --beta chromium
$ sudo snap refresh chromium
Workaround don't have chromium
Another solution is to uninstall chromium all together.
I'm on a project where I have multiple SPA on Angular JS, all written in typescript. I have the following directory structure:
src/
├── app
│ ├── frontend
│ │ ├── ...
│ │ └── frontend.module.ts
│ ├── backend
│ │ ├── ...
│ │ └── backend.module.ts
├── app.frontend.module.ts
├── app.backend.module.ts
Files at the root of src/ are the entry point for each app, they contain the following code (here for the frontend):
import * as angular from "angular";
import { FrontendModuleName } from './app/frontend/frontend.module';
angular.module('app', [FrontendModuleName]);
angular.bootstrap(document, ['app'], {
strictDi: true
});
So I should be able to tell Webpack to compile "src/app.frontend.module.ts", the compiler then follows the imports and everything gets merged nicely.
It works fine, but even if I explicitly tell Webpack to compile a single file, all of them are always compiled.
To give you an example, let's take this very basic configuration:
const path = require('path');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: {
frontend: './app.frontend.module.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js',
},
module: {
loaders: [
{
test: /\.ts(x?)$/,
loaders: ['ts-loader']
}
]
}
};
Executing this will compile app.frontend.module.ts as requested BUT also app.backend.module.ts !
After some time I found out that it's not Webpack but the Typescript compiler who seems at fault, so I changed my .tsconfig to try to exclude the root files, like so :
{
"compilerOptions": {
...
},
"exclude": [
"node_modules",
"dist",
"dev",
"reports",
"./src/app.*.module.ts"
]
}
In a sense it works because it now ignores app.backend.module.ts, but it still tries to compile every .ts file in the src/app/backend/ directory!
That's where I am right now.. I've searched in the compiler options reference but didn't found any option to prevent the compiler to recursively compile everything.
In fact..
..I've found a very very ugly workaround that I don't find satisfying at all. There is the files options that can be used to specify what files should be compiled, but I cannot give it an empty array or an exception is thrown.
So I created an empty dummy.ts file in the src/ folder and it seems to work as expected:
{
"compilerOptions": {
...
},
"files": ["src/dummy.ts"],
"exclude": [
"node_modules",
"dist",
"dev",
"reports",
"./src/app.*.module.ts"
]
}
But I can't imagine there is no better way to handle this.
Any idea would be much appreciated.
Thanks for your help.
I am trying to clear the cloudflare cache for single urls programmatically after put requests to a node.js api. I am using the https://github.com/cloudflare/node-cloudflare library, however I can't figure out how to log a callback from cloudflare. According to the test file in the same repo, the syntax should be something like this:
//client declaration:
t.context.cf = new CF({
key: 'deadbeef',
email: 'cloudflare#example.com',
h2: false
});
//invoke clearCache:
t.context.cf.deleteCache('1', {
files: [
'https://example.com/purge_url'
]
})
How can I read out the callback from this request?
I have tried the following in my own code:
client.deleteCache(process.env.CLOUDFLARE_ZONE, { "files": [url] }, function (data) {
console.log(`Cloudflare cache purged for: ${url}`);
console.log(`Callback:${data}`);
})
and:
client.deleteCache('1', {
files: [
'https://example.com/purge_url'
]
}).then(function(a,b){
console.log('helllllllooooooooo');
})
to no avail. :(
Purging Cloudflare cache by url:
var Cloudflare = require('cloudflare');
const { CF_EMAIL, CF_KEY, CF_ZONE } = process.env;
if (!CF_ZONE || !CF_EMAIL || !CF_KEY) {
throw new Error('you must provide env. variables: [CF_ZONE, CF_EMAIL, CF_KEY]');
}
const client = new Cloudflare({email: CF_EMAIL, key: CF_KEY});
const targetUrl = `https://example.com/purge_url`;
client.zones.purgeCache(CF_ZONE, { "files": [targetUrl] }).then(function (data) {
console.log(`Cloudflare cache purged for: ${targetUrl}`);
console.log(`Callback:`, data);
}, function (error) {
console.error(error);
});
You can lookup cloudflare zone this way:
client.zones.browse().then(function (zones) {
console.log(zones);
})
Don't forget to install the current client version:
npm i cloudflare#^2.4.1 --save-dev
I wrote a nodejs module to purge cache for a entire website. It scan your "public" folder, build the full url and purge it on cloudflare:
You can run it using npx:
npm install -g npx
npx purge-cloudflare-cache your#email.com your_cloudflare_key the_domain_zone https://your.website.com your/public/folder
But, you can install it and run using npm too:
npm install -g purge-cloudflare-cache
purge your#email.com your_cloudflare_key the_domain_zone https://your.website.com your/public/folder
For a public/folder tree like:
├── assets
│ ├── fonts
│ │ ├── roboto-regular.ttf
│ │ └── roboto.scss
│ ├── icon
│ │ └── favicon.ico
│ └── imgs
│ └── logo.png
├── build
│ ├── main.css
│ ├── main.js
├── index.html
It will purge cache for files:
https://your.website.com/index.html
https://your.website.com/build/main.css
https://your.website.com/build/main.js
https://your.website.com/assets/imgs/logo.png
https://your.website.com/assets/icon/favicon.ico
https://your.website.com/assets/fonts/roboto.css
https://your.website.com/assets/fonts/roboto-regular.ttf
This is probably happening because my mocha tests don't wait for the callback to return.
https://github.com/mochajs/mocha/issues/362