Open nichtsam opened 2 months ago
I have the same issue.
For now handling it with vite-env-only
works well.
import { serverOnly$ } from "vite-env-only";
export const handle: SEOHandle = {
getSitemapEntries: serverOnly$(async (request) => {
// your logic
}),
};
Describe the bug
Regarding the third example in this section: https://github.com/nasa-gcn/remix-seo?tab=readme-ov-file#configuration
handle
is used byuseMatches
which ends up in client-side. https://remix.run/docs/en/main/route/handleThat leads to this error:
Server-only module referenced by client
.Your Example Website or App
None
Steps to Reproduce the Bug or Issue
use any server-side code in
getSitemapEntries
inhandle
Expected behavior
being able to generate sitemap entries with server-side code.
Screenshots or Videos
No response
Platform
Additional context
No response