An error occurred while creating a new user: TypeError: Failed to construct 'URL': Invalid URL
- 0
- Auth
- Web
Hi , I`m trying to set up a createUser function , I get this error in my console , I saw a lot of threads about checking my .env.local file but it seems totally correct with all my keys , what should I be looking for here? I have really tried everything
The full errr is : app-index.js:33 An error occurred while creating a new user: TypeError: Failed to construct 'URL': Invalid URL at Users.create (users.mjs:77:17) at createUser (patient.actions.ts:10:35) at onSubmit (PatientForm.tsx:47:34) at eval (index.esm.mjs:2256:23)
my appwrite.config.ts : import * as sdk from "node-appwrite";
export const { NEXT_PUBLIC_ENDPOINT, PROJECT_ID, API_KEY, DATABASE_ID, PATIENT_COLLECTION_ID, APPOINTMENT_COLLECTION_ID, NEXT_PUBLIC_BUCKET_ID: BUCKET_ID, } = process.env;
const client = new sdk.Client();
client.setEndpoint(NEXT_PUBLIC_ENDPOINT!).setProject(PROJECT_ID!).setKey(API_KEY!);
export const databases = new sdk.Databases(client); export const users = new sdk.Users(client); export const messaging = new sdk.Messaging(client); export const storage = new sdk.Storage(client);
Check that NEXT_PUBLIC_ENDPOINT
is a valid URL
Recommended threads
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...