"SyntaxError: invalid regexp group" for "REST - Params" example in Firefox
See original GitHub issueDescribe 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
- Open the printed URL in Firefox.
- 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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran the test you mentioned in Firefox Developer Edition 78 and it pass 👍
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.