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 Script: Invalid regular expression

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Browser:

  • Chrome version 74
  • Firefox version XX
  • IE version XX
  • Edge version XX
  • Safari version XX

Library version


Library version: 1.0.1

## Current behavior
As soon as the script is loaded it throws the regex error and "Msal is not defined". Seems to work fine in a local environment, but fails on Azure app service.

## Expected behavior
Successfully load...

## Minimal reproduction of the problem with instructions
There was no problem when run locally, but it won't load when deployed to an Azure app service.

bug

I think it’s related to here:

var re_btou = new RegExp([
  '[\xC0-\xDF][\x80-\xBF]',
  '[\xE0-\xEF][\x80-\xBF]{2}',
  '[\xF0-\xF7][\x80-\xBF]{3}'
].join('|'), 'g');

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Pheilcommented, Jun 21, 2019

Here’s my results running locally with my Chrome extension.

1.0.2 Min - NoK 1.0.2 - OK 1.0.1 Min - NoK 1.0.1 - OK 1.0.0 Min - OK 1.0.0 - OK

I’m not an expert, but shouldn’t the minimization not change the code @hunterwebapps mentioned to this? Looks almost like an encoding conversion issue.

re_btou=new RegExp(["[À-ß][€-¿]","[à -ï][€-¿]{2}","[ð-÷][€-¿]{3}"]

0reactions
DarylThayilcommented, Sep 9, 2019

great closing issue, thanks for feedback

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: invalid regular expression flag "x" - MDN Web Docs
The JavaScript exception "invalid regular expression flag" occurs when the flags in a regular expression contain any flag that is not one of:...
Read more >
JavaScript minification fails containing certain Regex
JavaScript regex engine always allows an unescaped / in a RegExp constructor notation and you may use an unescaped / forward slash inside ......
Read more >
When minify is used js error message occur - WordPress.org
Hi! I get Uncaught SyntaxError: Invalid regular expression: missing / when i use Litespeed cache plugins minify functionality. When i turn of minify...
Read more >
JavaScript SyntaxError - Invalid regular expression flag "x"
This JavaScript exception invalid regular expression flag occurs if the flags, written after the second slash in RegExp literal, are not from ...
Read more >
How to react to invalid search regex? — DataTables forums
dataTables.js:4476 Uncaught SyntaxError: Invalid regular expression: /(/: Unterminated group at new RegExp (<anonymous>) at ...
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