#[SOLVED] Error with ID.unique() 'Account already exists'

19 messages · Page 1 of 1 (latest)

sweet cliff
#

Errors:

handleNext @ GetStarted.jsx?t=1737645252900:138
await in handleNext
callCallback2 @ chunk-PBXWVHXV.js?v=314ed5d2:3674
invokeGuardedCallbackDev @ chunk-PBXWVHXV.js?v=314ed5d2:3699
invokeGuardedCallback @ chunk-PBXWVHXV.js?v=314ed5d2:3733
invokeGuardedCallbackAndCatchFirstError @ chunk-PBXWVHXV.js?v=314ed5d2:3736
executeDispatch @ chunk-PBXWVHXV.js?v=314ed5d2:7014
processDispatchQueueItemsInOrder @ chunk-PBXWVHXV.js?v=314ed5d2:7034
processDispatchQueue @ chunk-PBXWVHXV.js?v=314ed5d2:7043
dispatchEventsForPlugins @ chunk-PBXWVHXV.js?v=314ed5d2:7051
(anonymous) @ chunk-PBXWVHXV.js?v=314ed5d2:7174
batchedUpdates$1 @ chunk-PBXWVHXV.js?v=314ed5d2:18913
batchedUpdates @ chunk-PBXWVHXV.js?v=314ed5d2:3579
dispatchEventForPluginEventSystem @ chunk-PBXWVHXV.js?v=314ed5d2:7173
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-PBXWVHXV.js?v=314ed5d2:5478
dispatchEvent @ chunk-PBXWVHXV.js?v=314ed5d2:5472
dispatchDiscreteEvent @ chunk-PBXWVHXV.js?v=314ed5d2:5449Understand this errorAI
GetStarted.jsx?t=1737645283713:130 
        
        
       POST https://cloud.appwrite.io/v1/account 409 (Conflict)
(anonymous) @ appwrite.js?v=314ed5d2:469
(anonymous) @ appwrite.js?v=314ed5d2:28
__awaiter @ appwrite.js?v=314ed5d2:10
call @ appwrite.js?v=314ed5d2:466
(anonymous) @ appwrite.js?v=314ed5d2:590
(anonymous) @ appwrite.js?v=314ed5d2:28
__awaiter @ appwrite.js?v=314ed5d2:10
create @ appwrite.js?v=314ed5d2:562
handleNext @ GetStarted.jsx?t=1737645283713:130
callCallback2 @ chunk-PBXWVHXV.js?v=314ed5d2:3674
invokeGuardedCallbackDev @ chunk-PBXWVHXV.js?v=314ed5d2:3699
invokeGuardedCallback @ chunk-PBXWVHXV.js?v=314ed5d2:3733
invokeGuardedCallbackAndCatchFirstError @ chunk-PBXWVHXV.js?v=314ed5d2:3736
executeDispatch @ chunk-PBXWVHXV.js?v=314ed5d2:7014
processDispatchQueueItemsInOrder @ chunk-PBXWVHXV.js?v=314ed5d2:7034
processDispatchQueue @ chunk-PBXWVHXV.js?v=314ed5d2:7043
dispatchEventsForPlugins @ chunk-PBXWVHXV.js?v=314ed5d2:7051
(anonymous) @ chunk-PBXWVHXV.js?v=314ed5d2:7174
batchedUpdates$1 @ chunk-PBXWVHXV.js?v=314ed5d2:18913
batchedUpdates @ chunk-PBXWVHXV.js?v=314ed5d2:3579
dispatchEventForPluginEventSystem @ chunk-PBXWVHXV.js?v=314ed5d2:7173
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-PBXWVHXV.js?v=314ed5d2:5478
dispatchEvent @ chunk-PBXWVHXV.js?v=314ed5d2:5472
dispatchDiscreteEvent @ chunk-PBXWVHXV.js?v=314ed5d2:5449Understand this errorAI
GetStarted.jsx?t=1737645283713:141 Signup error: AppwriteException: A user with the same id, email, or phone already exists in this project.
    at _Client.<anonymous> (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=314ed5d2:484:15)
    at Generator.next (<anonymous>)
    at fulfilled (http://localhost:5173/node_modules/.vite/deps/appwrite.js?v=314ed5d2:13:24)```
Create user full code:
```jsx
  const handleNext = async () => {
    if (step === 1) {
      try {
        if (!formData.email.includes('@')) {
          setError('Please enter a valid email address');
          return;
        }
  
        const response = await account.create(
          ID.unique(),
          formData.email,
          formData.password,
          formData.name
        );
        console.log('User created:', response);
        
        setUserSession(response.$id);
  
        await account.createVerification('http://localhost:5173/verify-email?userId=' + response.$id);
  
        setStep(step + 1);
      } catch (err) {
        console.error('Signup error:', err);
        if (err.message.includes('already exists')) {
          setError('This email is already registered. Please try logging in instead.');
        } else {
          setError(err.message);
        }
      }
    } else {
      setStep(step + 1);
    }
  };```
Form variables:
```jsx
  const [formData, setFormData] = useState({
    name: '',
    email: '',
    password: '',
    accountType: '',
  });```
#

@opaque gyro ^

#

Do you want the forms html snippet too ?

opaque gyro
#

If you before acount create do

...
const id = ID.unique();
console.log(id);
console.log(email);
...
#

what are the results

sweet cliff
#

i tried creating an account yesterday with an email that had a deleted account and it said the same error so maybe the clouds just buggin

opaque gyro
#

So is it still not working?

#

You might be running into an issue if you have an active session and are trying to create an account.

sweet cliff
sweet cliff
opaque gyro
sweet cliff
#

dangg, so If I self host thooo technicallyyy 👀

opaque gyro
opaque gyro
sweet cliff
sweet cliff