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.

Building in Docker causes Invalid US-ASCII character "\xF0"

See original GitHub issue

In this specific example I am using Docker (and jekyll) to build the site, but I believe the problem lies with the encoding the os in the Docker image is using. I am specifically using the ruby:2.6.5 docker image, but other images may provide the same error too.

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

The primary cause of this is the use of emoji’s in the scss comments.

      Jekyll Feed: Generating feed for posts
           Assets:  Invalid US-ASCII character "\xF0"
         Asset File /app/node_modules/carbon-components/scss/globals/scss/styles.scss:9
  Liquid Exception: Sass Error in /_layouts/default.html
/usr/local/bundle/gems/jekyll-assets-3.0.12/lib/jekyll/assets/tag.rb:211:in `e_sass': Sass Error (Sass::SyntaxError)

The above error is specific for the globe emoji in the comments in styles.scss

Removing the emoji gets past the error, until the next file with an emoji is handled.

Is this issue related to a specific component?

Any component with emojis in the scss comments

What version of the Carbon Design System are you using?

"carbon-components": "^10.7.2"

Steps to reproduce the issue

  1. Clone from https://github.com/kabanero-io/kabanero-landing
  2. Comment out ENV LANG C.UTF-8 in the Dockerfile
  3. run ./ci/build.sh
  4. The error appears in the build. Uncomment the ENV line from step 2 and it will work successfully.

Additional information

This issue is more informational since the workaround/fix is to add that ENV var in the dockerfile for UTF-8 Encoding (see steps to reproduce). It might make sense to not include emojis in the scss comments as they do sometimes provide Docker build issues like this one and don’t really offer much value.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alohr51commented, Oct 30, 2019

Commenting again to highlight a workaround / fix

For my specific image, ruby:2.6.5 I was able to add this env var to my Dockerfile before I built my site

ENV LANG C.UTF-8

This allowed the build to understand the encoding of the emojis and build successfully.

Found from https://github.com/docker-library/docs/blob/master/ruby/content.md#encoding

0reactions
alohr51commented, Jan 7, 2020

@joshblack I believe so

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid US-ASCII character using SASS - Stack Overflow
I can't edit the code. The code is in a library that isn't imported until a build is started. Changing the file encoding...
Read more >
Unicode & Character Encodings in Python: A Painless Guide
In this tutorial, you'll get a Python-centric introduction to character encodings and unicode. Handling character encodings and numbering systems can at ...
Read more >
Troubleshoot volume errors - Docker Documentation
This topic discusses errors which may occur when you use Docker volumes or bind mounts. Error: Unable to remove filesystem 🔗. Some container-based...
Read more >
Setting Locale in Docker - Lei Mao's Log Book
It turns out that it is the system locale problem. In the native system, the locale is usually properly set from the GUI...
Read more >
Solving locale issues with docker containers - Mike my bytes
Each of them may be build from different based image - with another OS or configuration. Everything should be just fine, unless we...
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