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.

Minified builds do not work in some circumstances

See original GitHub issue

Minified 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

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:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
badfilescommented, Mar 7, 2018

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.

1reaction
Zashcommented, Mar 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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