Billy Hawkes
Billy Hawkes10mo ago

This page needs to bail out of prerendering at this point because it used revalidate: 0

I've been testing out partial prerendering with next using tRPC but having some issues. Everytime I build It breaks ppr due to having a revalidate 0 but I can't find where it occurs. I revalidate in the link is an hour. Here is the server caller I am using:
const createPublicContext = cache(() => {
return createTRPCContext({
headers: new Headers({ cookie: "", "x-trpc-source": "rsc" }),
userId: null,
});
});

export const publicApi = experimental_createTRPCNextAppDirServer<
typeof appRouter
>({
config() {
return {
transformer: SuperJSON,
links: [
loggerLink({
enabled: (op) => true,
}),
experimental_nextCacheLink({
revalidate: 60 * 60,
router: appRouter,
createContext: createPublicContext,
}),
],
};
},
});
const createPublicContext = cache(() => {
return createTRPCContext({
headers: new Headers({ cookie: "", "x-trpc-source": "rsc" }),
userId: null,
});
});

export const publicApi = experimental_createTRPCNextAppDirServer<
typeof appRouter
>({
config() {
return {
transformer: SuperJSON,
links: [
loggerLink({
enabled: (op) => true,
}),
experimental_nextCacheLink({
revalidate: 60 * 60,
router: appRouter,
createContext: createPublicContext,
}),
],
};
},
});
Heres the call that triggers this:
const newReleases = await publicApi.resource.album.newReleases.query();
const newReleases = await publicApi.resource.album.newReleases.query();
And heres the route:
newReleases: publicProcedure.query(async ({ ctx: { spotify } }) => {
return await spotify.browse.getNewReleases();
}),
newReleases: publicProcedure.query(async ({ ctx: { spotify } }) => {
return await spotify.browse.getNewReleases();
}),
All my versions are on "next" All the code can be found here: https://github.com/hackthebois/RecordScratch/tree/ppr Its also odd because sometimes it builds and sometimes it doesn't. Any help is much appreciated.
No description
2 Replies
Erkan
Erkan7mo ago
any updates ?
Erkan
Erkan7mo ago
GitHub
[Partial Prerendering] Error: Runtime exited with error: signal: se...
Link to the code that reproduces this issue https://github.com/juliusmarminge/trellix-trpc To Reproduce no clue... happens seemingly random in prod, never had it locally Current vs. Expected behavi...