imagekit-nodejs
imagekit-nodejs copied to clipboard
Uncaught TypeError: url_1.URLSearchParams is not a constructor
we are trying to implement cropping tool using image kit. with below code
const params = {
width: completedCrop.width,
height: completedCrop.height,
x: completedCrop.x,
y: completedCrop.y,
}
const imgURL = imagekit.url({
src: imageUrl,
transformation: [params],
})
imagekit is an object of ImageKit(...) with private and public keys.
React Version: 18.2.0 Node version: 18.20.1 imagekit version: 5.0.1
Hi @veeresh2022 could you please share you TypeScript version and tsconfig.json file to replicate the issue. Also, if you intend to crop an image, you might be missing some properties. Using only x and y alone will not help you can use cropMode with it. Refer the below code.
const params = {
width: completedCrop.width,
height: completedCrop.height,
x: completedCrop.x,
y: completedCrop.y,
cm: "extract"
}
const imgURL = imagekit.url({
src: imageUrl,
transformation: [params],
})
For more information on ImageKit cropping, refer the docs.