Skip to content
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

Safari - Invalid Regular Expression - Invalid Group Specifier Names #197

Closed
5 tasks done
CodesAreHonest opened this issue Jun 11, 2021 · 4 comments · Fixed by #199
Closed
5 tasks done

Safari - Invalid Regular Expression - Invalid Group Specifier Names #197

CodesAreHonest opened this issue Jun 11, 2021 · 4 comments · Fixed by #199

Comments

@CodesAreHonest
Copy link

Background Information

  • Module Version: 3.14.0
  • Node/Browser Version: 16.1.0

The issue I'm reporting is with:

  • json2csv
  • csv2json

I have...

  • searched to see if an issue has already been reported.
  • verified that my JSON/CSV data is valid (using something like http://jsonlint.com or https://csvlint.io/).
  • tried upgrading to the latest version of json-2-csv (since the issue may already be fixed).

Expected Behavior

  • The library should works in Safari browser in MacOS and iOS.

Actual Behavior

Screenshot 2021-06-11 at 3 28 55 PM

The browser complains the error (refer screenshot above) due to Lookbehind Regex does not support in Safari.

Discussion

The library use doc-path as dependencies.
Refer this line, the function state use Negative Lookbehind Regex to perform exec leads to the mentioned errors and break in the browser.

@mrodrig
Copy link
Owner

mrodrig commented Jun 13, 2021

Thanks for reporting this @CodesAreHonest. I'll work on getting a fix out for this very soon. I'll post back with an update once I have a new release published to NPM that fixes this.

@CodesAreHonest
Copy link
Author

Appreciate your response on this issue, looking forward for the fixes and thanks for the awesome library !

mrodrig added a commit to mrodrig/doc-path that referenced this issue Jun 13, 2021
As reported in mrodrig/json-2-csv#197, many
browsers don't support negative look behind RegExps, which causes both
calls to this module and dependency modules to fail when that logic was
invoked. In order to fix that, this commit reworks the RegExp to be use
a string character parser to find first index where a non-escaped '.'
character is found.
mrodrig added a commit to mrodrig/doc-path that referenced this issue Jun 13, 2021
As reported in mrodrig/json-2-csv#197, many
browsers don't support negative look behind RegExps, which causes both
calls to this module and dependency modules to fail when that logic was
invoked. In order to fix that, this commit reworks the RegExp to be use
a string character parser to find first index where a non-escaped '.'
character is found.
mrodrig added a commit to mrodrig/doc-path that referenced this issue Jun 13, 2021
* Remove negative lookbehind regexp logic.

As reported in mrodrig/json-2-csv#197, many
browsers don't support negative look behind RegExps, which causes both
calls to this module and dependency modules to fail when that logic was
invoked. In order to fix that, this commit reworks the RegExp to be use
a string character parser to find first index where a non-escaped '.'
character is found.

* chore(release): 3.0.1
mrodrig added a commit that referenced this issue Jun 13, 2021
As reported in #197, there was a compatibility issue introduced in
doc-path@3.0.0 where a negative lookbehind Regexp was being used despite
not being supported by many browsers. This caused runtime errors when
this library's functionality was called due to the underlying dependency
compatibility issue. This commit bumps the version to 3.0.1 which fixes
the compatibility issue in the doc-path module.

Fixes #197
mrodrig added a commit that referenced this issue Jun 13, 2021
* Update doc-path to fix negative lookbehind regexp.

As reported in #197, there was a compatibility issue introduced in
doc-path@3.0.0 where a negative lookbehind Regexp was being used despite
not being supported by many browsers. This caused runtime errors when
this library's functionality was called due to the underlying dependency
compatibility issue. This commit bumps the version to 3.0.1 which fixes
the compatibility issue in the doc-path module.

Fixes #197

* chore(release): 3.14.1
@mrodrig
Copy link
Owner

mrodrig commented Jun 13, 2021

Thanks again for reporting this @CodesAreHonest. The fixed version should be up on NPM now as version 3.14.1. Please feel free to let me know if you run into any other issues.

@CodesAreHonest
Copy link
Author

My pleasure to help, the latest version work like charm in the Safari environment.

Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants