Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The error "URL.search is not implemented" occurs when using openai.createImage in Expo React Native because Expo currently does not fully support the WHATWG URL API, which includes the search property. This property is used by the openai.createImage function to extract query parameters from the URL.

To work around this issue, you can try using the deprecated URLSearchParams API to extract the query parameters from the URL. You can replace the following line of code:

const params = new URL(url).searchParams;

with:

const params = new URLSearchParams(new URL(url).search);

Alternatively, you can try using a different image generation API or library that does not rely on the URL API.