Skip to content

Live reload fails when 1 file changes and that file is a CSS/SCSS with @import #6106

Closed

Description

@bep

This was an head scratcher for me as I had only 1 site failing to autoreload when I maded changes to a SCSS. This looks like a bug in https://github.com/livereload/livereload-js and you will typically see this in the Chrome console:

Uncaught TypeError: link.getAttribute is not a function
    at Reloader.linkHref (livereload.js?port=1313&mindelay=10&v=2:1744)
    at livereload.js?port=1313&mindelay=10&v=2:1642
    at pickBestMatch (livereload.js?port=1313&mindelay=10&v=2:1421)
    at Reloader.reloadStylesheet (livereload.js?port=1313&mindelay=10&v=2:1642)
    at Reloader.reload (livereload.js?port=1313&mindelay=10&v=2:1499)
    at LiveReload.performReload (livereload.js?port=1313&mindelay=10&v=2:1089)
    at Object.message (livereload.js?port=1313&mindelay=10&v=2:1069)
    at Object.message (livereload.js?port=1313&mindelay=10&v=2:708)
    at Parser.process (livereload.js?port=1313&mindelay=10&v=2:1321)
    at Connector._onmessage (livereload.js?port=1313&mindelay=10&v=2:840)

For the above to happen:

  • You need an @import in your styles
  • The change must only result in 1 changed (CSS) file; else we fall back to a hard browser refresh (and that works fine)

Activity

  1. added this to the v0.56 milestone on Jul 22, 2019
  2. self-assigned this
    on Jul 22, 2019
  3. github-actions commented on Feb 18, 2022

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions