Karma: Chrome no longer supports HTML imports as of version 80

Created on 6 Feb 2020  路  6Comments  路  Source: karma-runner/karma

It seems that having removed HTML imports in Chrome 80 breaks things involving fetching HTML files via <link href="%s.html" rel="import"> style imports. It appears that the files are still fetched, but they are no longer executed, leaving karma to show 0 tests being run in my setup. Using Chrome 79 and below works fine.

released support

Most helpful comment

For anyone stuck with this one, we have managed to run our specs using a Chromium binary.

  1. Download Chromium 79 or older for your platform from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html
  2. Unzip the folder in a local directory e.g. /Users/theo/Downloads/chrome-mac/
  3. Set CHROME_BIN=/Users/theo/Downloads/chrome-mac/Chromium.app/Contents/MacOS/Chromium yarn test

All 6 comments

Until a fix can be applied, you can add a custom launcher that adds the --enable-blink-features=HTMLImports flag to allow HTML imports again.

For anyone stuck with this one, we have managed to run our specs using a Chromium binary.

  1. Download Chromium 79 or older for your platform from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html
  2. Unzip the folder in a local directory e.g. /Users/theo/Downloads/chrome-mac/
  3. Set CHROME_BIN=/Users/theo/Downloads/chrome-mac/Chromium.app/Contents/MacOS/Chromium yarn test

What do you guys expect Karma to do about it?

This feature has been removed from the only browser where it was supported and HTML Imports feature is obsolete. So the best we can do is to add a notice to the documentation that it does not work in the latest browsers.

Depending on your use case you may try setting type to dom to inline the imported files, setting the flag or adding a polyfill for HTLM imports.

:tada: This issue has been resolved in version 5.2.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wellyshen picture wellyshen  路  4Comments

schippie picture schippie  路  5Comments

simonh1000 picture simonh1000  路  3Comments

jhildenbiddle picture jhildenbiddle  路  4Comments

TKTheTechie picture TKTheTechie  路  4Comments