Closed bogdanrn closed 4 years ago
This would be an easy fix, but I think you shouldn't use Got on non-Node.JS platforms (like a Browser).
From the documentation:
For browser usage, we recommend Ky by the same people.
I believe this was fixed in the latest Firefox version where they started using the same regex code as Chrome. We don't intend to work around this as the main target for Got is Node.js.
Describe the bug
When the
got
package is being used as part of a dependency in a meteor project, the regex used here:https://github.com/sindresorhus/got/blob/master/source/core/index.ts#L2313
Makes the web-app unable to load in firefox (chrome works fine). I guess the same bug would happen if webpack is used as well.
Actual behavior
Firefox throws error in console:
SyntaxError: invalid regexp group
. Breaks the whole script.Expected behavior
No firefox error when a regex check is done.
Code to reproduce
Run the following line in firefox console
Checklist