Polyfill for URL is incomplete and causes crash with apollo-server #22594
Labels
Partner
Platform: Linux
Building on Linux.
Resolution: Locked
This issue was locked by the bot.
Type: Discussion
Long running discussion.
Environment
Description
To add non-URL (local) Blob support, a simple polyfill for one static method on the URL object was added here:
react-native/Libraries/Blob/URL.js
Line 53 in be56a3e
(note that the ctor throws)
This triggers an exception Apollo Server tries to do a
new URL()
here:https://github.com/apollographql/apollo-server/blob/458bc71eadde52483ccaef209df3eb1f1bcb4424/packages/apollo-datasource-rest/src/RESTDataSource.ts#L79
It then uses the SearchParams collection on the URL to add parameters:
https://github.com/apollographql/apollo-server/blob/458bc71eadde52483ccaef209df3eb1f1bcb4424/packages/apollo-datasource-rest/src/RESTDataSource.ts#L218
And then constructs a string, implicitly calling the url.toString() method:
https://github.com/apollographql/apollo-server/blob/458bc71eadde52483ccaef209df3eb1f1bcb4424/packages/apollo-datasource-rest/src/RESTDataSource.ts#L233
Reproducible Demo
The text was updated successfully, but these errors were encountered: