
because i am following a tutorial, where i am pretty sure i have done everything correct

what tutorial


the appwrite section where i am stuck at the end is at hour 1

add a log in your catch
export const createUser = async (user: CreateUserParams) => {
try {
// Create new user -> https://appwrite.io/docs/references/1.5.x/server-nodejs/users#create
const newuser = await users.create(
ID.unique(),
user.email,
user.phone,
undefined,
user.name
);
return parseStringify(newuser);
} catch (error: any) {
// Check existing user
if (error && error?.code === 409) {
const existingUser = await users.list([
Query.equal("email", [user.email]),
]);
return existingUser.users[0];
}
console.error("An error occurred while creating a new user:", error);
}
};

do you get that error?

is your env file setup correctly?


yes my env file shoud be correct

i went over it again before reaching for support

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:8:33) at onSubmit (PatientForm.tsx:51:36) at eval (index.esm.mjs:2256:23)

thats the whole error

Sure, looks like something is not formatted correctly. Maybe the email?

it should all be string

What do you have in your .env for ENDPOINT



thats my endpoint

so you've got NEXT_PUBLIC_ENDPOINT=https://cloud.appwrite.io/v1
?

correct

this is my .env.public

i only do this for training if you wonder

change it to just .env

I thought nextjs only support .env, .env.local, .env.development, and .env.production out of the box.

that didnt change anything i thinj
Recommended threads
- Getting 500 error code during redirectio...
I am getting this error with openid connect oauth2 with keycloak i am using appwrite version 15.5.5 an keycloaks version 23.0 (error 500 after logging in using ...
- Don't see settings under Auth for OAuth ...
Hi the documentation says to enable OAuth2 for google it is under Auth settings but i don't see settings under auth tab. Can some help me?
- How to send a code when reseting passwor...
Hi, I am new to appwrtie. I am builing a mobile applcation on react native. Is there a way to send a 4 digit code for verification when resting passwords for a ...
