-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError: Invalid regular expression
in Safari
#142
Comments
I believe this could be fixed by using the regular expression from |
could you share what you have tried? ...wondering why you even use this package at all in the browser... all browser already have support for FormData already. |
I replaced the offending regular expressions in formdata-to-blob.js and esm.min.js (
I came across this problem more or less by accident and I thought I should at least open an issue, even if it isn't really relevant for my project. It might be relevant for someone else. If you really want to know, my project is using |
Since version 4.0.5 or, to be more precise, since commit 6adcb7d, both formdata-to-blob.js and esm.min.js fail to load in Safari with the error
SyntaxError: Invalid regular expression: invalid group specifier name
. This is due to the fact that commit 6adcb7d introduced regular expressions for eol normalization, which use lookbehind (?<!
).Sadly, Safari still doesn't support lookbehind in regular expressions. And even worse, this error doesn't happen when the offending code is being executed, but instead, it already happens when the source file containing it is being parsed, which in turn prevents execution of any code in the same source file. I.e., the error happens, even if the offending code is not even being used.
The text was updated successfully, but these errors were encountered: