Skip to content

Styles should not be inserted into HEAD in Safari #492

Closed
faceyspacey/extract-css-chunks-webpack-plugin
#195
@theKashey

Description

@theKashey
  • Operating System: OSX
  • Node Version: does not matter
  • NPM Version: does not matter
  • webpack Version: does not matter
  • mini-css-extract-plugin Version: does not matter

Expected Behavior

Expected that application behaviour would be the same across different browsers.

Actual Behavior

In Safari the whole rendering would be suspended while style, added to the head, is loading.
Adding style to the body resolves the problem.

Code

This example reproduces an issue originally created for loadable-components.

It delays serving for .css file for 10 second, and all this time nothing is rendered.

How Do We Reproduce?

  1. add link to the head in Safary
  2. render some animation (like counter) in on the page
  3. page is expected to be fronzen all time link is loading the data

How to fix?

For Safari "dynamic" styles has to be added into Body. It resolves the issue.

  • ongoing PR Add support for the insert option #459 should fix the problem, however it should be considered as a default behavior.
  • I would say that's a WebKit bug, but could not find something at their bug tracker
  • see this PR for a bit more context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions