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

Breaking URL generation with 6.0.0 #111

Open
grallm opened this issue Jan 29, 2025 · 0 comments
Open

Breaking URL generation with 6.0.0 #111

grallm opened this issue Jan 29, 2025 · 0 comments

Comments

@grallm
Copy link

grallm commented Jan 29, 2025

Hi! I upgraded my Imagekit package from 5.2.0 to 6.0.0 and the URL generation has a breaking change which doesn't seem to be described in the changelogs.

I do see that the URL generation changed when I look at the changelogs: "fix url for '"
But if what I understand is correct, this shouldn't be affecting me.

Reproduction

const generateImageKitUrl = () => {
    const imagekit = new ImageKit({
        publicKey: config.imagekit.publicKey,
        privateKey: config.imagekit.privateKey,
        urlEndpoint:
            "https://ik.imagekit.io" + "/test/test2/",
    });

    const imageKitConfig: UrlOptions = {
        path: "/" + "71d7d317-ae4e-4003-82fd-ca6929b1e549.png",
        signed: true,
        expireSeconds: expiryTimeInMs / 1000,
    };

    return imagekit.url(imageKitConfig);
};

Problem

With the code above I would expect

https://ik.imagekit.io/test/test2/71d7d317-ae4e-4003-82fd-ca6929b1e549.png

because that's how it worked before, and that's how it is described in the documentation

But I get

https://ik.imagekit.io/test/test2//71d7d317-ae4e-4003-82fd-ca6929b1e549.png

Workaround

I guess I can remove the "/" in path: "/" + "71d7d317-ae4e-4003-82fd-ca6929b1e549.png",

Thanks you! 😄

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

1 participant