-
-
Notifications
You must be signed in to change notification settings - Fork 113
emojis in the comments cause issues in IE debugger #111
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
Comments
This project is tested against IE9 too after transpilation and not a single issue has ever came out so I wonder why aren't you serving minified/transpiled version to IE11 ? |
or better, I feel like your tools are on your way, incompatible with UTF-8 charset files. I don't think it should be hyperHTML concern fix your bundler issues to be honest, I feel like this is a webpack bug instead. |
The are no run-time errors, so it works, but ruins the debugging experience. I'd love to use the minified version, but the This is not an issue with webpack (or browserify, or rollup), as I pointed in my examples to codepen and jsbin without any build tools. Adding |
7 months out already and not an issue so far, not sure why this would be an issue. You also don't debug hyperHTML, this repository does that for you, and it's 100% code covered already.
possibly relevant? All I am saying is that hyperHTML is tested against IE11 already so I'm not sure what is your issue, exactly, or how you can solve it. You can already test the live page against IE11 without issues, right? That uses the unminified version. People also don't want the main field to point to an already transpiled file so there are no solutions if not removing emoji from the comments. However, this is not a solution, is a workaround for problems you are having with your tool-chain. I don't want to deal with UTF-8 incapable tools in general, I don't ASCII sanitize everything I write or comment in my source code comments and I'm not planning to make that a thing. Can you please explain to me what is the problem, in the real-world, that you are trying to solve? |
IE11after Babel |
I think the problem is related to the debugging experience. It looks like the problem is related to the source maps somehow? It's not about testing or coverage i think. But having emojis inside comments is a bit much... |
look, I'm the creator and maintainer of the twemoji library, I cannot imagine myself dealing with all the Open Source projects in this world that used emoji as comments or, actually, as text content for some expected behavior. I don't think source code should care about this, if it's saved as UTF-8 compatible file, tools should handle them as UTF-8. imagine by default a project would like to show a message with an emoji, the logic here is that such file shouldn't be able to do that because tools are on the way? This bit, I don't get it 🤷♂️ |
Here's the minimal repro: https://github.com/asapach/hyper-emoji Run Instead of correct source maps at the end of the file: //# sourceMappingURL=main.bundle.js.map And in the console you should see:
Instead of:
The only explanation I have is that it's IE's fault, not webpack's as illustrated in the examples above. P.S.
Perhaps nobody is using it in production yet? |
what about this config? const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './index.js',
devtool: 'source-map',
plugins: [
new webpack.optimize.UglifyJsPlugin({
beautify: true,
comments: false,
mangle: false
}),
new HtmlWebpackPlugin({
title: 'Press F12'
})
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
}
}; would this work as solution?
if that's the case I might drop emoji in comments but I hope you understand this IE11 thing is painful for every library on earth, if you cannot even write a code comment without thinking side effects |
Sorry, this will not work for development, because we want comments in all our code. Another option is adding "browser": "min.js", This will allow bundlers to use the minified version by default and have |
yes, I am |
Thanks. |
We're using webpack to bundle code, so we rely on
main
field inpackage.json
, which points toindex.js
which is the unminified version. The problem is that IE seems to fail to parse the emojis correctly and chops off several characters at the end of the file:Here is the codepen - all I did was to point it to the unminified version. Try debugging it in IE11.
Here's an isolated example in JSBin (since other online editors seem to inline the JS which works fine): https://plnkr.co/edit/qprwDOSOKjcwFNH0kzVe?p=preview
This:
Becomes this:

The main problem is that if there are source maps comments at the end of the bundle they get chopped off as well and it becomes impossible to debug.
I'm not sure how to fix this properly: either remove the emojis or switch the
main
field to the minified version to get rid of the comments.The text was updated successfully, but these errors were encountered: