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 regexp group" for "REST - Params" example in Firefox

See original GitHub issue

Describe the bug

SyntaxError: invalid regexp group

Environment

  • msw: 0.19.3
  • nodejs: irrelevant
  • npm: irrelevant

Firefox 77.0.1 (64-bit) MacOS

To Reproduce

$ yarn test:focused test/rest-api/params.mocks.ts
  1. Open the printed URL in Firefox.
  2. Perform a fetch('https://api.github.com/users/:username/messages/abc-123') request from your browser’s console.

Expected behavior

The regular expression pattern string provided to the pathToRegExp function is a valid regular expression.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LeBenLeBencommented, Jun 17, 2020

I ran the test you mentioned in Firefox Developer Edition 78 and it pass 👍

0reactions
kettanaitocommented, Jul 16, 2020

There is no plan to support this at the moment. The recommendation is to wait until the next version of Firefox is released, or use a different browser with a named capture groups in RegExp support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox gives SyntaxError: invalid regexp group - Stack Overflow
For me, it was because I thought I'd be clever and try to used named capture groups in my regex... Firefox punished me....
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 of:...
Read more >
Invalid regexp literal shows wrong line and column number
SyntaxError : invalid regexp group shown with incorrect line number ... For example, just include the regex line/column in the error message itself?...
Read more >
"use strict" not allowed in function with non-simple parameters ...
A "use strict" directive is not allowed at the top of such functions per the ECMAScript specification. Examples. Function statement. In this case,...
Read more >
Groups and backreferences - JavaScript - MDN Web Docs
Groups group multiple patterns as a whole, and capturing groups provide extra submatch information when using a regular expression pattern ...
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