#Warning Extra attributes from the server class

2 messages · Page 1 of 1 (latest)

coarse cipher
#

Hi, I'm trying to use next 13 and I'm getting a warning in dev mode

import React from "react";
import prisma from "../../lib/prisma";

async function getUsers() {
  const users = await prisma.user.findMany({
    take: 10,
  });
  // The return value is *not* serialized
  // You can return Date, Map, Set, etc.

  // Recommendation: handle errors
  if (!users) {
    // This will activate the closest `error.js` Error Boundary
    throw new Error("Failed to fetch users data");
  }

  return users;
}

export default async function Page() {
  const users = await getUsers();
  return (
    <div className={"border border-2 "}>
      <h1>Users</h1>
      <ul>
        {users.map((user) => (
          <li key={user.id}>
            <span>{user.name}</span>
          </li>
        ))}
      </ul>
    </div>
  );
}

The data is displayed. What is this warning about and how to fix it

keen zealot
#

Ist prisma the only function in lib? And default?