Invalid Regular Expression - 3.7.0
See original GitHub issueJust upgraded to 3.7.0 and am getting the following error:
Uncaught SyntaxError: Invalid regular expression: /^\/about\/refund(?:\/(?=$))?$/: Stack overflow
at RegExp.exec (<anonymous>)
at Route.match (ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3808)
at ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3789
at nextEnter (ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3338)
at ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3790
at nextEnter (ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3338)
at ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3790
at nextEnter (ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3338)
at ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3790
at nextEnter (ostrio_flow-router-extra.js?hash=96883db4695d24ad4599b4bf3f9da15a27a28f8d:3338)
The error leads to this function, with m = this.regexp.exec(decodeURIComponent(pathname));
causing the issue.
Route.prototype.match = function(path, params) {
var keys = this.keys,
qsIndex = path.indexOf('?'),
pathname = ~qsIndex ? path.slice(0, qsIndex) : path,
m = this.regexp.exec(decodeURIComponent(pathname));
if (!m) return false;
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
var val = this.page._decodeURLEncodedURIComponent(m[i]);
if (val !== undefined || !(hasOwnProperty.call(params, key.name))) {
params[key.name] = val;
}
}
return true;
};
My route for that one looks like this:
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
FlowRouter.route('/about/refund', {
name: 'refund',
async action(params, queryParams) {
const { default: Layout } = await import('/client/layout')
const {
default: AboutRefund
} = await import('/imports/client/terms/refund')
mount(Layout, {
content: <AboutRefund />,
})
}
})
Am I doing something dumb here?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Syntax error: invalid regular expressions · Issue #13 - GitHub
When running the generator I get the following error in the console leading to not being able to run the generator.
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 >re — Regular expression operations — Python 3.11.1 ...
Source code: Lib/re/ This module provides regular expression matching operations similar to those found in Perl. Both patterns and strings to be searched ......
Read more >Uncaught SyntaxError: Invalid regular expression
I am seeing this error in developer console on chrome. Uncaught SyntaxError: Invalid regular expression: /['窶兢/: Unterminated character ...
Read more >SyntaxError: Invalid regular expression: - Stack Overflow
I'm pretty sure my regex is correct, but anytime I try to test the code, I get an invalid regular expression error with...
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
Fixed!
@jasongrishkoff please try latest
v3.7.1
release this issue should be fixed.Feel free to close it in case if the issue is solved on your end.