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

URLSearchParams #8

Closed
tylercollier opened this issue Mar 23, 2020 · 3 comments
Closed

URLSearchParams #8

tylercollier opened this issue Mar 23, 2020 · 3 comments

Comments

@tylercollier
Copy link

Would you consider allowing developers to specify the URLSearchParams implementation? The situation I'm running into is with React Native. When I use imagekit.url(...), I get the error not implemented. This is due to a bug in React Native. There is a way to get around it, but this bloats the bundle size, so it'd be better if I could instead include another implementation of URLSearchParams, such as this one. I'm guessing you'd do it like this:

const URLSearchParamsPolyfill = require('url-search-params-polyfill');

var imagekit = new ImageKit({
    publicKey : "your_public_api_key",
    urlEndpoint : "https://ik.imagekit.io/your_imagekit_id",
    authenticationEndpoint : "http://www.yourserver.com/auth",
    URLSearchParams: URLSearchParamsPolyfill,
});  
@imagekitio
Copy link
Collaborator

It seems that if we use . append method which is implemented instead of .set then it will work.

Please test the changes in latest version 1.2.1

@tylercollier
Copy link
Author

It works, thanks!

@tylercollier tylercollier mentioned this issue Apr 5, 2020
@rpavlovs
Copy link

Getting the same error on 1.3.7. This time it's .pathname

yarn.lock diff shows that url-polyfill was dropped when updating from 1.2.3

cspeer added a commit to cspeer/imagekit-javascript that referenced this issue Mar 22, 2023
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

No branches or pull requests

3 participants