@D5
I am facing this CORS error. I am using Vite as my frontend.
I tried setting up the Hostname to localhost and to * but still didnt work.
If anyone can check it out it would be great... thank you !
Thanks for creating the post! Do you have any other errors appart from this one?
And what's the code?
i just started the project :p
i will provide it one sec
@D5 i dont think i can provide the code because of my extensive folder / file structuring.
Not everything, only the appwrite code fragment
config.ts
import { Client, Account, Databases, Storage, Avatars } from 'appwrite';
export const appwriteConfig = {
projectId: import.meta.env.VITE_APPWRITE_PROJECT_ID,
url: import.meta.env.VITE_APPWRITE_URL
}
export const client = new Client();
client.setProject(appwriteConfig.projectId);
client.setEndpoint(appwriteConfig.url);
console.log("appwriteConfig.projectId", appwriteConfig.projectId)
console.log("appwriteConfig.url", appwriteConfig.url)
export const account = new Account(client);
export const databases = new Databases(client);
export const storage = new Storage(client);
export const avatars = new Avatars(client);
Signupform.ts
const SignupForm = () => {
const isLoading = false;
const form = useForm<z.infer<typeof SignupValidation>>({
resolver: zodResolver(SignupValidation),
defaultValues: {
name: "",
username: "",
email: "",
password: ""
},
})
async function onSubmit(values: z.infer<typeof SignupValidation>) {
const newUser = await createUserAccount(values)
console.log(newUser)
}
<form onSubmit={form.handleSubmit(onSubmit)} className="flex flex-col gap-5 w-full mt-4`">
</form>
im using **shadcn ** btw (it helps with some ui / forms ... )
@D5 good enough?
Yes
Are you sure that the project ID is correct?
Try setting client this way:
const client = new Client();
Also, could you please share the code for account creation?
Recommended threads
- Google login on mobile not working
Hi the gg login auth in mobile not working. No error show. But the user couldnt login in Attached is the video. Desktop is working well and im using custom doma...
- Appwrite 1.8.1 TablesDB Permissions Issu...
Hi - I'm migrating a newer VueJS web application from Supabase to Appwrite. I'm looking for an experienced Appwrite Developer to help me solve a permissions iss...
- Failed to create function
Hey everyone 👋 I'm having an issue creating Functions on Appwrite Cloud and I'm not sure if it's a platform bug or something wrong in my project. When I try t...