You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: Unable to load Plotly 4 due to missing utf8 #7993
Simply including the <script> via CDN doesn't working anymore when utf8 is missing. Some UTF RegEx couldn't be parsed.
Uncaught SyntaxError: Invalid regular expression: /[̀-ͯ]/g: Range out of order in character class https://cdn.plot.ly/plotly-4.0.0.js
Uncaught ReferenceError: Plotly is not defined
function sanitize(s) {
return s.normalize("NFD").replace(/[̀-ͯ]/g, "").normalize("NFC").toLowerCase().replace(/[ً-ٟ]/g, "").replace(/['‘’ʻʼʽˈ′`]/g, "").replace(/&/g, " and ").replace(/([,(])\s*the\b/g, "$1").replace(/[.(),[\]]/g, "").replace(/[-–—]/g, " ").replace(/\bst\b/g, "saint").trim().replace(/\s+/g, " ").replace(/^the\s+/, "");
}
The Sample from the ReadMe.md includes <script ... charset="utf-8">
But the examples on codepen doen't. They work on codepen but not when copied locally.
Ploty <= 3.7 didn't had this issue.
If only the sanitize function is introducing this problem I find it more beginner-friendly to remove these UTF8 RegEx.
Thanks for the report! I can see the issue you're describing in Chromium. That snippet is coming from plotly/country-iso-search, so the issue might need to be fixed there. At any rate, I'll look into it.
I have a PR up to fix the issue in plotly/country-iso-search, but it will take some time to get it into plotly.js. Once it's available, I'll upgrade the library and we'll get the fix out here in the next patch release.
Activity
camdecoster commentedon Aug 27, 2026
Thanks for the report! I can see the issue you're describing in Chromium. That snippet is coming from plotly/country-iso-search, so the issue might need to be fixed there. At any rate, I'll look into it.
camdecoster commentedon Aug 27, 2026
I have a PR up to fix the issue in plotly/country-iso-search, but it will take some time to get it into plotly.js. Once it's available, I'll upgrade the library and we'll get the fix out here in the next patch release.