safari 13 regExp error with flags u
See original GitHub issuethere is an error on safari 13 : SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern
And it will not happend on safari14.
I found it caused by
node_modules/monaco-editor/dev/vs/editor/editor.main.js line 104281
.replace(/([^\b_])(\p{Lu})(\p{Ll})/gmu, '$1_$2$3')
It look like a safari’s error, but I have no documents to prove it.
Can somebody tell me how to resolve it?
Or give me some safari’s documents?(I found nothing useful on Apple’s website)
Thx very much.
**monaco-editor version: 0.22.0 or 0.22.3 Browser: safari13 **OS:**10.15.7 Playground code that reproduces the issue:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:13 (4 by maintainers)
Top 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 ...
Read more >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 >NSRegularExpression | Apple Developer Documentation
An immutable representation of a compiled regular expression that you apply to Unicode strings. iOS 4.0+ iPadOS 4.0+ macOS 10.7+ Mac Catalyst 13.1+...
Read more >New JavaScript Features That Will Change How You Write ...
Regular expressions have been part of the JavaScript language since the ... Lookbehind assertions; Named capture groups; s ( dotAll ) Flag ......
Read more >require-unicode-regexp - ESLint - Pluggable JavaScript Linter
The u flag disables the recovering logic Annex B defined. As a result, you can find errors early. This is similar to the...
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 Free
Top 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
I’ve pushed another change to protect against this. The outcome of this last change is that
SnakeCaseAction
will simply not be available in Safari 13, but I could not test it since I have Safari 14.This will highly likely not fix it entirely. The Monaco editor has two regexes which need replacement and only then it works.