Closed Fitzpasd closed 6 years ago
I'm also hitting this
Hi! :wave: Thanks for the report.
Seems to be an issue with whatwg-url + JavaScriptCore (the JS engine that react-native uses when running on the client, when debugging via chrome it uses v8 and communicates over the native bridge via websockets)
I tried to reproduce this without setting up typescript. It still errored just by importing whatwg-url, but the message was different: new.target can't come after a prefix operator
I found this related discussion: https://github.com/jsdom/whatwg-url/issues/108
Seems like whatwg-url only supports node at the moment so you'd probably be best off trying a different lib.
Thanks for the extra info! I'll find an alternative lib :)
Another link I found seems to imply that the JSC bug was fixed late last year but I guess RN hasn't caught up: https://bugs.webkit.org/show_bug.cgi?id=157970#c17
When using the popular library whatwg-url, I get this unhelpful error:
I narrowed it down to this library by commenting out code locally. In the end, this is the cause:
Without that code, no error occurs. It's also interesting to note that if you're debugging via Chrome, this error doesn't occur.