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.

SyntaxError: Invalid regular expression: invalid group specifier name

See original GitHub issue

Hey, I’m getting this error here on iOS and macOS Safari:

SyntaxError: Invalid regular expression: invalid group specifier name

It comes from here:

// Remove duplicate slashes if not preceded by a protocol
if (urlObj.pathname) {
  urlObj.pathname = urlObj.pathname.replace(/(?<!https?:)\/{2,}/g, '/');
}

My code: https://github.com/muuvmuuv/portfolio/blob/master/src/elements/Link.jsx Live error: https://portfolio-git-development.muuvmuuv.now.sh/

I am using version 5.x

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:36 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
fcisiocommented, May 20, 2021

Hey, I’m coming from Gatsby, thanks a lot for this issue. As mentioned above, it’s a critical issue.

And this has been open for a while. Any Idea why there hasn’t been any progress on something that seems like a simple syntax error?

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Works in Chrome, but breaks in Safari: Invalid regular ...
I had the same issue, and it turned out to be a RegEx expression in one of my dependencies, namely Discord.js .
Read more >
SyntaxError: Invalid regular expression: invalid group ... - GitHub
I think this error is due to the fact that Safari does not support the "lookbehind" in regex. SyntaxError: Invalid regular expression: invalid...
Read more >
Safari will not load React App. Invalid regular expression
The error concern "Invalid regular expression: invalid group specifier name". A google search revealed that Safari does not support all ...
Read more >
Angular SyntaxError - Apple Developer
Angular SyntaxError: SyntaxError: Invalid regular expression: invalid group specifier name. ... Ideally I would like to see the regex that causing this.
Read more >
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 ...
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