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.

build includes @charset problem.

See original GitHub issue

i have same problem.

image

css: { preprocessorOptions: { css: { charset: false } } } don’t working

_Originally posted by @mesutgok in https://github.com/vitejs/vite/issues/5655#issuecomment-979144222_

Issue Analytics

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

github_iconTop GitHub Comments

14reactions
ducletcommented, Nov 29, 2021

Same issue and I ended up adding the following in vite.config.js:

  css: {
    postcss: {
      plugins: [
          {
            postcssPlugin: 'internal:charset-removal',
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === 'charset') {
                  atRule.remove();
                }
              }
            }
          }
      ],
    },
}
5reactions
Time-codingcommented, Dec 9, 2021
css: {
    preprocessorOptions: {
      scss: {
        charset: false
      },
      less: {
        charset: false,
      },
    },
    charset: false,
    postcss: {
      plugins: [{
        postcssPlugin: 'internal:charset-removal',
        AtRule: {
          charset: (atRule) => {
            if (atRule.name === 'charset') {
              atRule.remove();
            }
          }
        }
      }],
    },
  }

It works for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

PHP include html page charset problem - Stack Overflow
I was doing an include of a php file (I supose it's the same for html file) that wouldn't show utf-8. I couldn't...
Read more >
Charset issues - Apache FreeMarker Manual
When FreeMarker has to load a template file (or an unparsed text file), then it must know the charset of the file, since...
Read more >
Documentation: 15: 24.3. Character Set Support - PostgreSQL
The character set support in PostgreSQL allows you to store text in a variety of character sets (also called encodings), including single-byte character ......
Read more >
Encoding | IntelliJ IDEA Documentation - JetBrains
If IntelliJ IDEA displays characters in a file incorrectly, it probably couldn't detect the file encoding. In this case, you need to specify...
Read more >
HTML Character Sets - W3Schools
The HTML5 specification encourages web developers to use the UTF-8 character set! This has not always been the case. The character encoding for...
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