Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cypress 10.4+ in chrome 70 breaks with globalThis #23509

Closed
levinqdl opened this issue Aug 23, 2022 · 5 comments · Fixed by #23689
Closed

cypress 10.4+ in chrome 70 breaks with globalThis #23509

levinqdl opened this issue Aug 23, 2022 · 5 comments · Fixed by #23689
Assignees
Labels
CT Issue related to component testing type: bug

Comments

@levinqdl
Copy link

Current behavior

Cypress run on chrome 70 cannot start with error: "Uncaught ReferenceError: globalThis is not defined"

Desired behavior

cypress run with chrome 70

Test code to reproduce

Any test with cypress 10.4+ run on chrome 70 should reproduce.

Cypress Version

10.4+

Node version

v16.5.0

Operating System

linux

Debug Logs

root@me-cd-test-k8s-3137-446pp-dqxkt-wgg0b:/home/jenkins/agent/workspace/ME-CD/test-k8s# DEBUG=cypress:launcher:* node test.js cypress/prepare/role.cy.js /tmp/test-result/3137/admin
✔  Verified Cypress! /root/.cache/Cypress/10.4.0/Cypress
[16160:0823/155424.906310:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 16344: Permission denied (13)
[16344:0823/155425.028386:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
2022-08-23T07:54:28.962Z cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/m, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, binary: 'edge-canary', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, binary: 'edge-beta', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ]
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
2022-08-23T07:54:43.180Z cypress:launcher:detect detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ], minSupportedVersion: 64 }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ], minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'beta', displayName: 'Chrome Beta', versionRegex: /Google Chrome (\S+) beta/m, binary: 'google-chrome-beta', minSupportedVersion: 64 }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary', minSupportedVersion: 64 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox', minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ], minSupportedVersion: 86 }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ], minSupportedVersion: 86 }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/m, binary: [ 'edge', 'microsoft-edge' ], minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, binary: 'edge-canary', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, binary: 'edge-beta', minSupportedVersion: 79 }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, binary: [ 'edge-dev', 'microsoft-edge-dev' ], minSupportedVersion: 79 } ]

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        10.4.0                                                                         │
  │ Browser:        Chrome 70 (headless)                                                           │
  │ Node Version:   v16.5.0 (/usr/local/bin/node)                                                  │
  │ Specs:          1 found (role.cy.js)                                                           │
  │ Searched:       cypress/prepare/role.cy.js                                                     │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  role.cy.js                                                                      (1 of 1)
[cypress-log-to-output] Attempting to connect to Chrome Debugging Protocol
2022-08-23T07:54:44.983Z cypress:launcher:browsers launching browser { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '70.0.3538.77', path: 'google-chrome', minSupportedVersion: 64, majorVersion: 70, isHeadless: true, isHeaded: false }, url: 'about:blank' }
2022-08-23T07:54:44.985Z cypress:launcher:browsers spawning browser with args { args: [ 'about:blank', '--test-type', '--ignore-certificate-errors', '--start-maximized', '--silent-debugger-extension-api', '--no-default-browser-check', '--no-first-run', '--noerrdialogs', '--enable-fixed-layout', '--disable-popup-blocking', '--disable-password-generation', '--disable-single-click-autofill', '--disable-prompt-on-repos', '--disable-background-timer-throttling', '--disable-renderer-backgrounding', '--disable-renderer-throttling', '--disable-backgrounding-occluded-windows', '--disable-restore-session-state', '--disable-new-profile-management', '--disable-new-avatar-menu', '--allow-insecure-localhost', '--reduce-security-for-testing', '--enable-automation', '--disable-print-preview', '--disable-device-discovery-notifications', '--autoplay-policy=no-user-gesture-required', '--disable-site-isolation-trials', '--metrics-recording-only', '--disable-prompt-on-repost', '--disable-hang-monitor', '--disable-sync', '--disable-web-resources', '--safebrowsing-disable-download-protection', '--disable-client-side-phishing-detection', '--disable-component-update', "--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'", '--disable-default-apps', '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream', '--disable-ipc-flooding-protection', '--disable-backgrounding-occluded-window', '--disable-breakpad', '--password-store=basic', '--use-mock-keychain', '--disable-dev-shm-usage', '--disable-gpu', '--no-sandbox', '--proxy-server=http://localhost:39355', '--headless', '--window-size=1280,720', '--force-device-scale-factor=1', '--remote-debugging-port=33382', '--remote-debugging-address=127.0.0.1', '--user-data-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-16160', '--disk-cache-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-16160/CypressCache' ] }
2022-08-23T07:54:45.198Z cypress:launcher:browsers chrome stderr: [0823/155445.197221:ERROR:gpu_process_transport_factory.cc(980)] Lost UI shared context.
2022-08-23T07:54:45.200Z cypress:launcher:browsers chrome stderr: DevTools listening on ws://127.0.0.1:33382/devtools/browser/13cdca87-00d4-4c07-903c-5064f790ef5a
2022-08-23T07:54:45.208Z cypress:launcher:browsers chrome stderr: [0823/155445.206777:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 16474: Permission denied (13)
[cypress-log-to-output] Connected to Chrome Debugging Protocol
2022-08-23T07:54:46.896Z cypress:launcher:browsers chrome stderr: [0823/155446.895003:INFO:CONSOLE(39990)] "Uncaught ReferenceError: globalThis is not defined", source: http://me-e2e-cypress10.me.magic.com/__/assets/index.23f3e8ba.js (39990)

Other

globalThis is not supported in chrome 70, 10.4+ somehow use it directly in bundled code.

@mike-plummer mike-plummer self-assigned this Aug 23, 2022
@mike-plummer
Copy link
Contributor

Hi @levinqdl , thanks for reporting this issue! I have confirmed that we unintentionally introduced some code in Cypress v10.4.0 that is incompatible with older versions of Chrome. Cypress v10.3.1 appears to work as expected in Chrome v70. We'll get this routed to the team

@elevatebart
Copy link
Contributor

elevatebart commented Aug 23, 2022

We will have to add https://www.npmjs.com/package/@vitejs/plugin-legacy to the vite.config of app.

@baus
Copy link

baus commented Aug 25, 2022

@mike-plummer mike-plummer removed their assignment Aug 26, 2022
@rockindahizzy rockindahizzy self-assigned this Sep 6, 2022
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: in progress labels Sep 6, 2022
@cypress-bot cypress-bot bot added stage: review and removed stage: needs review The PR code is done & tested, needs review labels Sep 6, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 12, 2022

The code for this is done in cypress-io/cypress#23689, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 13, 2022

Released in 10.8.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.8.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants