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
Sourcemap from bundle is not utf-8 encoded #1035
Comments
https://github.com/webpack/webpack/blob/master/lib/SourceMapDevToolPlugin.js#L155
|
@sokra Sure, but I'm unsure where you mean I should put |
i think same issue here: #859 |
I came across this issue because I had a Unicode code point in my javascript that was being scrambled as My workaround: |
Did you send the correct UTF-8 HTTP Header from your server? Or did you add the utf-8 meta tag to the HTML page? |
I'm still getting this issue. Specifically some files being produced are non-utf8 so they cannot be understood by Sentry when I'm uploading them as release artifacts. That aside, from what I can gather the PR #1797 just seems to fix them when they're data-uri sourcemaps? How can I ensure that all files webpack outputs are utf-8 (using Windows)? |
Is this valid still? I can see the related PR was merged. |
Seeing as @rickihastings stil had the issue a couple of months later, probably not. I don't have a code base available to reproduce on |
I'm also having this issue, and like @rickihastings, I came upon this issue due to my source map not being readable by Sentry because the file is not utf8. I'm currently using Webpack 1.13.0 on macOS Sierra. I'm going to try updating to Webpack 1.14.0 and seeing if that resolves this issue - if it does then I'll report back here. |
@jordanmkoncz did it worked for you ? |
@bebraw I believe this issue is still valid. I'm using webpack@2.5.1 and I've got a multi-entry configuration. When I run
What could cause a sourcemap file to be encoded in non-utf8 character set? |
Not sure if this is related, but I just fond I need to add charset="utf-8" to the bundle.js script tag: <script src="bundle.js" type="text/javascript" charset="utf-8"></script>Without the charset attribute, I get weird characters even with just ■ |
Also running into this. Doesn't seem to be any pattern, i have files either encoded as utf-8 or us-ascii.
In fact, this is not limited to source maps. My bundles are also scattered, some utf-8, some us-ascii. I'd like them to all be utf-8 encoded. Can this be forced? I tried Using webpack 3.2 |
They are always utf-8 encoded. If you only use characters from the ascii range, us-ascii and utf-8 encoding look equal. > Buffer.from("abc", "utf-8")
<Buffer 61 62 63>
> Buffer.from("abc", "ascii")
<Buffer 61 62 63>
> Buffer.from("abcä", "ascii")
<Buffer 61 62 63 e4>
> Buffer.from("abcä", "utf-8")
<Buffer 61 62 63 c3 a4> |
hmm, interesting. I am trying to use a tool (sentry-cli) that uploads sourcemaps and it explodes saying "stream did not contain valid UTF-8". Might be something specific on their end in that case. |
Thank you. Was facing the same problem |
TODO: 日本語がソースマップ場で文字化けしてしまう現象があるので対応方法を検討する // 参考サイト: https://qiita.com/kenfdev/items/0ed70a1692bd2f119b69 // 参考サイト: webpack/webpack#1035
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
This can be seen in sourcemap
This is the actual bundle generated
The letter
å
is wrong. Not sure if it's Webpack's fault or Sourcemap's?Using Linux if that matters. Using
devtool: '#source-map'
This is a letter only used in comments, not actual source, so shouldn't be a real problem.
The text was updated successfully, but these errors were encountered: