Minified builds do not work in some circumstances
See original GitHub issueMinified builds found on CDN’s do not work. They produce errors related to emojione.
example
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="https://cdn.conversejs.org/3.3.2/css/converse.min.css">
<script src="https://cdn.conversejs.org/3.3.2/dist/converse.min.js"></script>
</head>
<body>
<script>
converse.initialize({
bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
show_controlbox_by_default: true
});
</script>
</body>
</html>
result in chrome
converse.min.js:sourcemap:293 Uncaught SyntaxError: Invalid regular expression: /<object[^>]*>.*?</object>|<span[^>]*>.*?</span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(?:ðŸ³)ï¸?â€?(?:🌈)|(?:ðŸ‘)ï¸?â€?(?:🗨)ï¸?|[#-9]ï¸?⃣|(?:(?:ðŸ´)(?:�[�-�]){1,6})|(?:�[�-�]){2}|(?:(?:�[��]))ï¸?(?:�[�-�])?â€?(?:[⚕⚖✈]|�[�-�]|�[������])|(?:�[��]|�[�-�])(?:�[�-�])?â€?[♀♂⚕⚖✈]?ï¸?|(?:(?:â¤|�[�-��])[â€ï¸]{0,2}){1,3}(?:â¤|�[�-��])|(?:(?:â¤|�[�-��])ï¸?){2,4}|(?:�[����-���-�]|�[��]|�[�-�]|�[�-�]|�[�-�]|⛹|👯)ï¸?(?:�[�-�])?â€?[♀♂]?ï¸?|(?:[â˜â›¹âœŠ-âœ]|�[�-�]|�[�-��-��-��-�]|�[�-�])ï¸?(?:�[�-�])|(?:[↔-↙↩-↪]ï¸?|[#*]|[〰〽]ï¸?|(?:�[�-�]|🆎|�[�-�])ï¸?|â“‚ï¸?|[㊗㊙]ï¸?|(?:�[�-�]|🈚|🈯|�[�-�]|�[�-�])ï¸?|[‼â‰]ï¸?|[â–ª-▫▶◀◻-â—¾]ï¸?|[©®]ï¸?|[™ℹ]ï¸?|🀄ï¸?|[⬅-⬇⬛-⬜ââ•]ï¸?|[⌚-⌛⌨ââ©-â³â¸-âº]ï¸?|ðŸƒ|[⤴⤵]ï¸?)|[✀-âž¿]ï¸?|[�-�][�-�]ï¸?|[☀-⛿]ï¸?|[0-9]ï¸/: Range out of order in character class
at new RegExp (<anonymous>)
at emojione (converse.min.js:sourcemap:293)
at converse.min.js:sourcemap:293
at converse.min.js:sourcemap:266
at converse.min.js:sourcemap:266
emojione @ converse.min.js:sourcemap:293
(anonymous) @ converse.min.js:sourcemap:293
(anonymous) @ converse.min.js:sourcemap:266
(anonymous) @ converse.min.js:sourcemap:266
workaround
Do not use minified builds
suggested temporary fixes
- stop building broken minified builds for the CDN
- stop using broken minified builds in the documentation, specifically where it is likely to confuse newbies like me: https://conversejs.org/docs/html/quickstart.html#getting-a-demo-up-and-running
ideal fix
- report upstream to the minify vendor.
Hope that’s enough data. I nearly gave up adopting this 2 hours after finding it, because it was hard for me to debug given lack of familiarity with the project.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Functioning code no longer working after being minified and ...
I have some code in a web worker that is working perfectly locally, but as soon as I build and deploy (which minifies...
Read more >"Minify JS" setting doesn't work when "Bundle JS" is disabled
The title says it all. These settings are under Build & Deploy --> Post processing --> Asset optimization. When “Bundle JS” is enabled, ......
Read more >Developers - Minified builds do not work in some circumstances -
Minified builds do not work in some circumstances.
Read more >Minifying - SurviveJS
Minification process analyzes your source code and turns it into a smaller form with the same meaning if you use safe transformations. ·...
Read more >Minify Resources (HTML, CSS, and JavaScript)
Deprecated. This page was written for version 4 of the PageSpeed Insights API, which is deprecated and will be shut down in May...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I confirm this issue.
<meta charset=utf-8>
fixes running the minified version for me. I use another charset, and the minified version is somehow incompatible with mine.The error looks like something feed UTF-8 data into a parser expecting Latin1. There doesn’t seem to be any encoding specified on the HTML data from those pages on
hashbang.info
, nor from the CDN. Possible cause? See if adding<meta charset=utf-8>
appears to fix it.