question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: @charset may only be used at the root of a document.

See original GitHub issue

Take this document one.sass:

@charset "UTF-8"
/*  © Yajo
.other
    @import "other"

Then this another _other.sass:

@charset "UTF-8"
/*  © Yajo
.someclass
    display: none

Then:

sass \
        --cache-location /var/cache/sass\
        --compass\
        --require bootstrap-sass\
        --update /app:/app\

Says:

      error /app/...../static/src/css/_other.sass (Line 1: @charset may only be used at the root of a document.)

… but I need UTF8 for ©! And docs say that @charset only goes into CSS when there’s any non-ASCII character, so it should even be automatic.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chriseppsteincommented, Apr 18, 2016

I discussed this with @nex3 and we decided that it should be considered a bug.

0reactions
nex3commented, Apr 6, 2018

I’m moving this issue to the new Ruby Sass repository because it’s specific to Ruby Sass’s implementation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

charset utf-8 validation error in wordpress site - Stack Overflow
I'm trying to pass a wordpress site from https://validator.w3.org/ . I have fixed all errors apart from the "CSS: The @charset rule may...
Read more >
charset - CSS: Cascading Style Sheets - MDN Web Docs
The @charset CSS at-rule specifies the character encoding used in the style sheet. It must be the first element in the style sheet...
Read more >
Resolving validation errors - amp.dev
In this section, we'll go through and resolve the AMP validation errors from our AMP page. Note that the errors may appear in...
Read more >
The meta element - HTML Standard - WhatWG
The html element represents the root of an HTML document. Authors are encouraged to specify a lang attribute on the root html element, ......
Read more >
file_put_contents - Manual - PHP
It should be obvious that this should only be used if you're making one write, ... file_put_contents does not issue an error message...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found