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

Karma 6.x fails to load in IE9 #3665

Closed
Krinkle opened this issue Mar 14, 2021 · 6 comments · Fixed by #3668
Closed

Karma 6.x fails to load in IE9 #3665

Krinkle opened this issue Mar 14, 2021 · 6 comments · Fixed by #3668
Labels

Comments

@Krinkle
Copy link
Contributor

Krinkle commented Mar 14, 2021

Updating from karma 5.2.3 to 6.2.0 I find that the tests no longer load in IE9, for example via SauceLabs on the https://github.com/js-reporters/js-reporters repository:

IE 10.0 (Windows 7): Executed 23 of 23 SUCCESS (0.232 secs / 0.029 secs)
IE 10.0 (Windows 7): Executed 23 of 23 SUCCESS (0.232 secs / 0.029 secs)
Firefox 45.0 (Windows 7): Executed 23 of 23 SUCCESS (0.199 secs / 0.061 secs)
Edge 15.15063 (Windows 10): Executed 23 of 23 SUCCESS (0.312 secs / 0.075 secs)
IE 11.0 (Windows 7): Executed 23 of 23 SUCCESS (0.21 secs / 0.034 secs)
Chrome 58.0.3029.81 (Windows 7): Executed 23 of 23 SUCCESS (0.216 secs / 0.045 secs)
Edge 88.0.705.50 (Windows 10): Executed 23 of 23 SUCCESS (0.186 secs / 0.024 secs)
14 03 2021 02:04:20.287:WARN [launcher]: internet explorer 9  on SauceLabs have not captured in 60000 ms, killing.
14 03 2021 02:05:23.193:WARN [launcher]: internet explorer 9  on SauceLabs have not captured in 60000 ms, killing.
14 03 2021 02:05:26.784:ERROR [launcher]: internet explorer 9  on SauceLabs failed 2 times (timeout). Giving up.

In the video recording, I see that the "Karma is Idle" page appears but nothing after that. No further error what I could find, so probably something very early on. Perhaps something with socket.io, or unsupported ES6+ syntax or method in client changes?

Krinkle added a commit to js-reporters/js-reporters that referenced this issue Mar 14, 2021
Except:
* qunitjs: Pinned indefinitely.
* sinon: Pinned indefinitely.
* karma: Pin temporarily to workaround IE9 failure
  karma-runner/karma#3665
@johnjbarton
Copy link
Contributor

Yes we saw this also. The issue turned out to be a use of a ES feature in socket.io client that IE9 did not support. Since it is not practical to change socket.io or stay on v2, we gave up on IE9 (not a big loss, very little use now=)

Karma 6 does not test on IE9, but we did choose to continue to support IE11.

@Krinkle
Copy link
Contributor Author

Krinkle commented Mar 15, 2021

Ack, I saw the removal of IE9 from CI, and I saw a proposal for Karma 7 at #3503. But I saw no note of IE9 support removal in the Karma 6 release notes.

I don't mind dropping support for IE9 in end-user applications, but for Karma it would have a pretty big cascading effect as it would mean projects like js-reporters and QUnit cannot test themselves in IE9 and by extension that would mean everyone using QUnit also has to drop support for IE9 for any kind of library or application before upgrading. For now we can version-pin, and ideally browsers and CI environments are stable and thus that can continue to work. However given how much Node versions change, browser launchers etc, it's not unlikely we'll need to update to Karma 6 at some point in order for other things to work. Having Karma 6 as last major release for old IE would be nice, it could be retained in a branch for a while after the main branch moves to Karma 7 for any essential backports needed.

@johnjbarton
Copy link
Contributor

I think we could delay or otherwise work around issues in the karma client (eg transpiling if we really want to use modern syntax).

However, freezing the socket-io level to support IE9 seems unwise. At some point IE9 support needs to end I don't know of a compelling reasons that point is not now. I don't know how to move the ecosystem other than to take a tiny step forward.

@devoto13
Copy link
Collaborator

I agree with @johnjbarton that we want to drop IE9 and IE10 as usage is tiny, supporting these browsers becomes a burden for Karma and blocks Karma from moving forward (e.g. use WebSockets directly instead of socket.io). But I also see how this change might be disruptive for some Karma users and it was not clearly announced as a breaking change in v6.

According to https://socket.io/docs/v3/client-installation/index.html, socket.io supports IE9, so it is probably some tiny change needed somewhere in our code to get it working. I'll see how hard it is to fix.

@devoto13
Copy link
Collaborator

I've just tried to run tests on IE9 and apparently they pass: https://automate.browserstack.com/dashboard/v2/builds/353284844776d04545344febcc9ac02d87a7b113/sessions/754cc7a656eadfaf9abc8d7462d2724bbb793a07?buildStatuses=running&buildUserIds=3623869 (requires auth). The problem is that on initial page load the page does not connect back to the Karma server, but after reload it successfully connects and tests pass. I have no idea why this happens. I'll try to poke around more in the coming days.

devoto13 added a commit to devoto13/karma that referenced this issue Mar 28, 2021
So the symptom is that after Karma page is loaded in IE9 the tests don't run and Karma is stuck at the "starting" step. Reloading the page once or twice makes IE9 connect to the server and tests pass successfully.

After an "exciting" debugging session I figured out that the problem is that on the first load (and sometimes after the page reload) [`io` variable](https://github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14), which should be set by the `socket.io.js` script is undefined. It looks like IE9 silently stops executing `socket.io.js` script somewhere midway and switches to the next script causing the `io` variable to be undefined. I assume it hits some limit or threshold or whatnot. Couldn't find much information on the Internet, besides people experiencing similar issues when loading e.g. unminified jQuery and their own code firing before the `$` variable is available. No good solutions found.

Checking the `socket.io.js` contents, I have noticed that v2 served the minified client script on that path, while v3 now serves the unminified code. Presumably the huge script size is what causing IE9 to choke. Switching back to the minified socket.io client bundle allows tests to pass in IE9.

With the fix, tests passed 5 times in a row, while without it they fail every time, so I assume it does resolve the problem.

Fixes karma-runner#3665
devoto13 added a commit to devoto13/karma that referenced this issue Mar 28, 2021
So the symptom is that after Karma page is loaded in IE9 the tests don't run and Karma is stuck at the "starting" step. Reloading the page once or twice makes IE9 connect to the server and tests pass successfully.

After an "exciting" debugging session I figured out that the problem is that on the first load (and sometimes after the page reload) [`io` variable](https://github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14), which should be set by the `socket.io.js` script is undefined. It looks like IE9 silently stops executing `socket.io.js` script somewhere midway and switches to the next script causing the `io` variable to be undefined. I assume it hits some limit or threshold or whatnot. Couldn't find much information on the Internet, besides people experiencing similar issues when loading e.g. unminified jQuery and their own code firing before the `$` variable is available. No good solutions found.

Checking the `socket.io.js` contents, I have noticed that v2 served the minified client script on that path, while v3 now serves the unminified code. Presumably the huge script size is what causing IE9 to choke. Switching back to the minified socket.io client bundle allows tests to pass in IE9.

With the fix, tests passed 5 times in a row, while without it they fail every time, so I assume it does resolve the problem.

Fixes karma-runner#3665
johnjbarton pushed a commit that referenced this issue Mar 29, 2021
So the symptom is that after Karma page is loaded in IE9 the tests don't run and Karma is stuck at the "starting" step. Reloading the page once or twice makes IE9 connect to the server and tests pass successfully.

After an "exciting" debugging session I figured out that the problem is that on the first load (and sometimes after the page reload) [`io` variable](https://github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14), which should be set by the `socket.io.js` script is undefined. It looks like IE9 silently stops executing `socket.io.js` script somewhere midway and switches to the next script causing the `io` variable to be undefined. I assume it hits some limit or threshold or whatnot. Couldn't find much information on the Internet, besides people experiencing similar issues when loading e.g. unminified jQuery and their own code firing before the `$` variable is available. No good solutions found.

Checking the `socket.io.js` contents, I have noticed that v2 served the minified client script on that path, while v3 now serves the unminified code. Presumably the huge script size is what causing IE9 to choke. Switching back to the minified socket.io client bundle allows tests to pass in IE9.

With the fix, tests passed 5 times in a row, while without it they fail every time, so I assume it does resolve the problem.

Fixes #3665
karmarunnerbot pushed a commit that referenced this issue Mar 29, 2021
## [6.3.2](v6.3.1...v6.3.2) (2021-03-29)

### Bug Fixes

* fix running tests in IE9 ([#3668](#3668)) ([0055bc5](0055bc5)), closes [/github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14](https://github.com//github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js/issues/L14) [#3665](#3665)
@karmarunnerbot
Copy link
Member

🎉 This issue has been resolved in version 6.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Krinkle added a commit to js-reporters/js-reporters that referenced this issue Mar 29, 2021
Except:
* qunitjs: Pinned indefinitely.
* sinon: Pinned indefinitely.
* karma: Pin temporarily to workaround IE9 failure
  karma-runner/karma#3665
Krinkle added a commit to js-reporters/js-reporters that referenced this issue Mar 29, 2021
Except:
* qunitjs: Pinned indefinitely.
* sinon: Pinned indefinitely.
* karma: Pin temporarily to workaround IE9 failure
  karma-runner/karma#3665
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Jun 17, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [karma](https://karma-runner.github.io/) ([source](https://github.com/karma-runner/karma)) | devDependencies | minor | [`6.3.20` -> `6.4.0`](https://renovatebot.com/diffs/npm/karma/6.3.20/6.4.0) |

---

### Release Notes

<details>
<summary>karma-runner/karma</summary>

### [`v6.4.0`](https://github.com/karma-runner/karma/blob/HEAD/CHANGELOG.md#&#8203;640-httpsgithubcomkarma-runnerkarmacomparev6320v640-2022-06-14)

[Compare Source](karma-runner/karma@v6.3.20...v6.4.0)

##### Features

-   support SRI verification of link tags ([dc51a2e](karma-runner/karma@dc51a2e))
-   support SRI verification of script tags ([6a54b1c](karma-runner/karma@6a54b1c))

#### [6.3.20](karma-runner/karma@v6.3.19...v6.3.20) (2022-05-13)

##### Bug Fixes

-   prefer IPv4 addresses when resolving domains ([e17698f](karma-runner/karma@e17698f)), closes [#&#8203;3730](karma-runner/karma#3730)

#### [6.3.19](karma-runner/karma@v6.3.18...v6.3.19) (2022-04-19)

##### Bug Fixes

-   **client:** error out when opening a new tab fails ([099b85e](karma-runner/karma@099b85e))

#### [6.3.18](karma-runner/karma@v6.3.17...v6.3.18) (2022-04-13)

##### Bug Fixes

-   **deps:** upgrade socket.io to v4.4.1 ([52a30bb](karma-runner/karma@52a30bb))

#### [6.3.17](karma-runner/karma@v6.3.16...v6.3.17) (2022-02-28)

##### Bug Fixes

-   **deps:** update colors to maintained version ([#&#8203;3763](karma-runner/karma#3763)) ([fca1884](karma-runner/karma@fca1884))

#### [6.3.16](karma-runner/karma@v6.3.15...v6.3.16) (2022-02-10)

##### Bug Fixes

-   **security:** mitigate the "Open Redirect Vulnerability" ([ff7edbb](karma-runner/karma@ff7edbb))

#### [6.3.15](karma-runner/karma@v6.3.14...v6.3.15) (2022-02-05)

##### Bug Fixes

-   **helper:** make mkdirIfNotExists helper resilient to concurrent calls ([d9dade2](karma-runner/karma@d9dade2)), closes [/github.com/karma-runner/karma-coverage/issues/434#issuecomment-1017939333](https://github.com//github.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333)

#### [6.3.14](karma-runner/karma@v6.3.13...v6.3.14) (2022-02-05)

##### Bug Fixes

-   remove string template from client code ([91d5acd](karma-runner/karma@91d5acd))
-   warn when `singleRun` and `autoWatch` are `false` ([69cfc76](karma-runner/karma@69cfc76))
-   **security:** remove XSS vulnerability in `returnUrl` query param ([839578c](karma-runner/karma@839578c))

#### [6.3.13](karma-runner/karma@v6.3.12...v6.3.13) (2022-01-31)

##### Bug Fixes

-   **deps:** bump log4js to resolve security issue ([5bf2df3](karma-runner/karma@5bf2df3)), closes [#&#8203;3751](karma-runner/karma#3751)

#### [6.3.12](karma-runner/karma@v6.3.11...v6.3.12) (2022-01-24)

##### Bug Fixes

-   remove depreciation warning from log4js ([41bed33](karma-runner/karma@41bed33))

#### [6.3.11](karma-runner/karma@v6.3.10...v6.3.11) (2022-01-13)

##### Bug Fixes

-   **deps:** pin colors package to 1.4.0 due to security vulnerability ([a5219c5](karma-runner/karma@a5219c5))

#### [6.3.10](karma-runner/karma@v6.3.9...v6.3.10) (2022-01-08)

##### Bug Fixes

-   **logger:** create parent folders if they are missing ([0d24bd9](karma-runner/karma@0d24bd9)), closes [#&#8203;3734](karma-runner/karma#3734)

#### [6.3.9](karma-runner/karma@v6.3.8...v6.3.9) (2021-11-16)

##### Bug Fixes

-   restartOnFileChange option not restarting the test run ([92ffe60](karma-runner/karma@92ffe60)), closes [#&#8203;27](karma-runner/karma#27) [#&#8203;3724](karma-runner/karma#3724)

#### [6.3.8](karma-runner/karma@v6.3.7...v6.3.8) (2021-11-07)

##### Bug Fixes

-   **reporter:** warning if stack trace contains generated code invocation ([4f23b14](karma-runner/karma@4f23b14))

#### [6.3.7](karma-runner/karma@v6.3.6...v6.3.7) (2021-11-01)

##### Bug Fixes

-   **middleware:** replace %X_UA_COMPATIBLE% marker anywhere in the file ([f1aeaec](karma-runner/karma@f1aeaec)), closes [#&#8203;3711](karma-runner/karma#3711)

#### [6.3.6](karma-runner/karma@v6.3.5...v6.3.6) (2021-10-25)

##### Bug Fixes

-   bump vulnerable ua-parser-js version ([6f2b2ec](karma-runner/karma@6f2b2ec)), closes [#&#8203;3713](karma-runner/karma#3713)

#### [6.3.5](karma-runner/karma@v6.3.4...v6.3.5) (2021-10-20)

##### Bug Fixes

-   **client:** prevent socket.io from hanging due to mocked clocks ([#&#8203;3695](karma-runner/karma#3695)) ([105da90](karma-runner/karma@105da90))

#### [6.3.4](karma-runner/karma@v6.3.3...v6.3.4) (2021-06-14)

##### Bug Fixes

-   bump production dependencies within SemVer ranges ([#&#8203;3682](karma-runner/karma#3682)) ([36467a8](karma-runner/karma@36467a8)), closes [#&#8203;3680](karma-runner/karma#3680)

#### [6.3.3](karma-runner/karma@v6.3.2...v6.3.3) (2021-06-01)

##### Bug Fixes

-   **server:** clean up vestigial code from proxy ([#&#8203;3640](karma-runner/karma#3640)) ([f4aeac3](karma-runner/karma@f4aeac3)), closes [/tools.ietf.org/html/std66#section-3](https://github.com//tools.ietf.org/html/std66/issues/section-3)

#### [6.3.2](karma-runner/karma@v6.3.1...v6.3.2) (2021-03-29)

##### Bug Fixes

-   fix running tests in IE9 ([#&#8203;3668](karma-runner/karma#3668)) ([0055bc5](karma-runner/karma@0055bc5)), closes [/github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14](https://github.com//github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js/issues/L14) [#&#8203;3665](karma-runner/karma#3665)

#### [6.3.1](karma-runner/karma@v6.3.0...v6.3.1) (2021-03-24)

##### Bug Fixes

-   **client:** clearContext after complete sent ([#&#8203;3657](karma-runner/karma#3657)) ([c0962e3](karma-runner/karma@c0962e3))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1412
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
anthony-redFox pushed a commit to anthony-redFox/karma that referenced this issue May 16, 2023
So the symptom is that after Karma page is loaded in IE9 the tests don't run and Karma is stuck at the "starting" step. Reloading the page once or twice makes IE9 connect to the server and tests pass successfully.

After an "exciting" debugging session I figured out that the problem is that on the first load (and sometimes after the page reload) [`io` variable](https://github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14), which should be set by the `socket.io.js` script is undefined. It looks like IE9 silently stops executing `socket.io.js` script somewhere midway and switches to the next script causing the `io` variable to be undefined. I assume it hits some limit or threshold or whatnot. Couldn't find much information on the Internet, besides people experiencing similar issues when loading e.g. unminified jQuery and their own code firing before the `$` variable is available. No good solutions found.

Checking the `socket.io.js` contents, I have noticed that v2 served the minified client script on that path, while v3 now serves the unminified code. Presumably the huge script size is what causing IE9 to choke. Switching back to the minified socket.io client bundle allows tests to pass in IE9.

With the fix, tests passed 5 times in a row, while without it they fail every time, so I assume it does resolve the problem.

Fixes karma-runner#3665
anthony-redFox pushed a commit to anthony-redFox/karma that referenced this issue May 16, 2023
## [6.3.2](karma-runner/karma@v6.3.1...v6.3.2) (2021-03-29)

### Bug Fixes

* fix running tests in IE9 ([karma-runner#3668](karma-runner#3668)) ([0055bc5](karma-runner@0055bc5)), closes [/github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js#L14](https://github.com//github.com/karma-runner/karma/blob/026fff870913fb6cd2858dd962935dc74c92b725/client/main.js/issues/L14) [karma-runner#3665](karma-runner#3665)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants