Skip to content

An error occurred while fetching your account #4943

@richleach

Description

@richleach

Link to reproduction

https://thebeatentrail-supabase.vercel.app/

Describe the Bug

I created a site deployment on Vercel for my Payload CMS application - everything has tested OK/passed on my dev server.
I received confirmation that my site built successfully - no errors. When I click the link https://thebeatentrail-supabase.vercel.app/ the site loads (my headers/footers/nav are all there) but any page that has content from the /admin is not loading, I get a 404 page displayed (by design). The console displays....

Uncaught (in promise) Error: An error occurred while fetching your account.

When I drill down into the error message I can see the following:

n.useEffect)(()=>{
let e = async()=>{
try {
let e = await fetch("".concat("https://thebeatentrail-supabase.vercel.app", "/api/users/me"), {
method: "GET",
credentials: "include",
headers: {
"Content-Type": "application/json"
}
});
if (e.ok) {
let {user: t} = await e.json();
l(t || null),
s(t ? "loggedIn" : void 0)
} else
throw Error("An error occurred while fetching your account.")
} catch (e) {
throw l(null),
Error("An error occurred while fetching your account.")
}
};

To Reproduce

I visit the link https://thebeatentrail-supabase.vercel.app/

.... the homepage, as an example, and even the page /terms (are pages I built using the /admin console of the CMS) will not load and the corresponding 404 messages are displayed.

The page /videos is a hard-coded file served from the file system (not my Supabase database). This page loads successfully.

Payload Version

"payload": "^2.0.0",

Adapters and Plugins

db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI,
},
push: false,
}),

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-reproIf an issue does not include a reproductionstatus: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions