#database error

12 messages · Page 1 of 1 (latest)

rare pilot
#

@cerulean terrace You don't need help with this now?

cerulean terrace
#

i have a new eror

#

479-20850f83e9357683.js:1

   POST https://cloud.appwrite.io/v1/databases/xx/collections/xx/documents 404 (Not Found)

(anonymous) @ 479-20850f83e9357683.js:1
_ @ 479-20850f83e9357683.js:1
(anonymous) @ 479-20850f83e9357683.js:1
(anonymous) @ 479-20850f83e9357683.js:1
x @ 479-20850f83e9357683.js:1
call @ 479-20850f83e9357683.js:1
(anonymous) @ 479-20850f83e9357683.js:1
(anonymous) @ 479-20850f83e9357683.js:1
x @ 479-20850f83e9357683.js:1
createDocument @ 479-20850f83e9357683.js:1
P @ page-21f92f285a83d4bf.js:1
r @ page-21f92f285a83d4bf.js:1
await in r (async)
(anonymous) @ 479-20850f83e9357683.js:1
await in (anonymous) (async)
a_ @ fd9d1056-a04a3401fa0deb6c.js:1
aR @ fd9d1056-a04a3401fa0deb6c.js:1
(anonymous) @ fd9d1056-a04a3401fa0deb6c.js:1
sF @ fd9d1056-a04a3401fa0deb6c.js:1
sM @ fd9d1056-a04a3401fa0deb6c.js:1
(anonymous) @ fd9d1056-a04a3401fa0deb6c.js:1
o4 @ fd9d1056-a04a3401fa0deb6c.js:1
iV @ fd9d1056-a04a3401fa0deb6c.js:1
sU @ fd9d1056-a04a3401fa0deb6c.js:1
uR @ fd9d1056-a04a3401fa0deb6c.js:1
uM @ fd9d1056-a04a3401fa0deb6c.js:1
sign-up:1 Third-party cookie will be blocked. Learn more in the Issues tab.
page-21f92f285a83d4bf.js:1 AppwriteException: Database not found
at I.<anonymous> (https://under18.vercel.app/_next/static/chunks/479-20850f83e9357683.js:1:17713)
at Generator.next (<anonymous>)
at s (https://under18.vercel.app/_next/static/chunks/479-20850f83e9357683.js:1:10952)

#

database error

atomic warren
cerulean terrace
#

Everything is fine when i run this code in vite. I get problems w n3xtjs

#

Do u have a template with login and sign-up for nextjs

atomic warren
cerulean terrace
#

Don't work.

atomic warren
cerulean terrace
#
"use client";
import { useState } from "react";
import { account, ID } from "./appwrite";

const LoginPage = () => {
  const [loggedInUser, setLoggedInUser] = useState(null);
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const [name, setName] = useState("");

  const login = async (email, password) => {
    const session = await account.createSession(email, password);
    setLoggedInUser(await account.get());
  };

  const register = async () => {
    await account.create(ID.unique(), email, password, name);
    login(email, password);
  };

  const logout = async () => {
    await account.deleteSession("current");
    setLoggedInUser(null);
  };

  if (loggedInUser) {
    return (
      <div>
        <p>Logged in as {loggedInUser.name}</p>
        <button type="button" onClick={logout}>
          Logout
        </button>
      </div>
    );
  }

  return (
    <div>
      <p>Not logged in</p>
      <form>
        <input
          type="email"
          placeholder="Email"
          value={email}
          onChange={(e) => setEmail(e.target.value)}
        />
        <input
          type="password"
          placeholder="Password"
          value={password}
          onChange={(e) => setPassword(e.target.value)}
        />
        <input
          type="text"
          placeholder="Name"
          value={name}
          onChange={(e) => setName(e.target.value)}
        />
        <button type="button" onClick={() => login(email, password)}>
          Login
        </button>
        <button type="button" onClick={register}>
          Register
        </button>
      </form>
    </div>
  );
};

export default LoginPage;

i get error with the account.get function

#

i dont remember the error