How can i fix it?
ig it should take a string. whats the error if you hover over the red lines? I don't see this issue.
also, whats the sdk version?
"dependencies": { "@hookform/resolvers": "^3.6.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-toast": "^1.1.5", "@tanstack/react-query": "^5.45.0", "@tanstack/react-query-devtools": "^5.45.0", "appwrite": "^15.0.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "lucide-react": "^0.394.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", "react-hook-form": "^7.51.5", "react-intersection-observer": "^9.10.3", "react-router-dom": "^6.23.1", "tailwind-merge": "^2.3.0", "zod": "^3.23.8" },
error TS2345: Argument of type '"top"' is not assignable to parameter of type 'ImageGravity | undefined'.
import {Client, ImageGravity, Storage} from 'appwrite';
const fileUrl = await storage.getFilePreview(
bucketId,
fileId,
2000,
2000,
ImageGravity.Top, // <<
100
);
this should work.
Wow, thanks
its not red now atleast
no worries :appwritecheers:.
do you know why any is red here?
should be string[] i think.
const queries[]: ?
const queries: string[] = ...
Query.* builders return string.
Thanks, one last question. Do you know why this is red?
hover over the errors so I can see the actual error.
not an expert in this, but most probably the params could be wrong ig. the function overloads doesn't expect/support what you've passed.
Okey, will try to fix it. Thanks for the help!
Are you good with building apps?
the apps I make, work fine, so ig yess? 🤣 only experienced in native though, no react and stuff.
btw, please mark the post title as [SOLVED] if your issues are resolved.
Happy Appwriting :appwritecheers:.
Recommended threads
- Re-connect site to domain verification f...
I have mistakenly deleted appwrite site without removing domain. Now I created same site and want to re-connect my domain. It gives this error while verify. How...
- SSR share session to client using custom...
Hi, so I was trying to get a hang of using SSR and using realtime updates in the same time which is done easiest if you have a custom domain in Appwrite and as ...
- Custom Domains with Cloudflare for SaaS ...
Hi! I'm using Appwrite Cloud Sites with Cloudflare for SaaS for multi-tenant custom domains. Problem: Custom domain: donate.pekeetong.my → CNAME to sites.dono...