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

Fails on @import inside stylesheets #83

Closed
bep opened this issue Jul 22, 2019 · 0 comments · Fixed by #84
Closed

Fails on @import inside stylesheets #83

bep opened this issue Jul 22, 2019 · 0 comments · Fixed by #84

Comments

@bep
Copy link
Contributor

bep commented Jul 22, 2019

I came upon an issue where CSS reload failed because of my SCSS and then my CSS had a font @import.

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)

I have debugged this, and it tries to resolve getAttribute in CSSImportRule, which obviously fails. In this case, CSSImportRule has no href and I don't see any way you can handle it without doing it from the owning stylesheet.

I have a patch for this which I will create a PR for in a minute.

See gohugoio/hugo#6106

bep added a commit to bep/livereload-js that referenced this issue Jul 22, 2019
@smhg smhg closed this as completed in 08654ac Dec 28, 2019
@smhg smhg closed this as completed in #84 Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant