#Error: Cannot access displayName.valueOf on the server. You cannot dot into a client module from a s

5 messages · Page 1 of 1 (latest)

arctic echo
#

"Error: Cannot access displayName.valueOf on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."

page.js:

import {
    Container, Paper,
    ScrollArea,
    Table,
    TableTbody,
    TableTd,
    TableTh,
    TableThead,
    TableTr,
    Text,
    Title
} from "@mantine/core";
import {getFreelancers} from "../../src/utils/fetch/getFreelancers";
import {formatDate} from "../../../helpers/formatDate";

export default async function Page() {

    const data = await getFreelancers();

    const rows = data.map((row) => (
        <TableTr key={row.name}>
            <TableTd>{row.id}</TableTd>
            <TableTd>{row.user_id}</TableTd>
            <TableTd>{formatDate(new Date(row.created_at))}</TableTd>
            <TableTd>{row.portfolio}</TableTd>
            <TableTd>{row.builtbybit}</TableTd>
            <TableTd>{row.vouchley}</TableTd>
            <TableTd>{row.completed_onboarding ? "Yes" : "No"}</TableTd>
        </TableTr>
    ));


    return(
        <Container size={1600} my="5rem">
            <Title c="#fff">Freelancers</Title>
            <Text mb="3rem" c="dimmed">See all freelancers</Text>

            <Paper p="1rem" bg="dark.8">
                <ScrollArea h={800}>
                    <Table miw={700}>
                        <TableThead>
                            <TableTr>
                                <TableTh>ID</TableTh>
                                <TableTh>Linked user</TableTh>
                                <TableTh>Created at</TableTh>
                                <TableTh>Portfolio</TableTh>
                                <TableTh>BuiltByBit</TableTh>
                                <TableTh>Vouchley</TableTh>
                                <TableTh>Completed onboarding</TableTh>
                            </TableTr>
                        </TableThead>
                        <TableTbody>{rows}</TableTbody>
                    </Table>
                </ScrollArea>
            </Paper>
        </Container>
    )
}
#

How can I fix this?

onyx gazelle
arctic echo
#

e.g. const data = await getFreelancers();. This function uses a client with secret keys