-
Notifications
You must be signed in to change notification settings - Fork 25
tanstack-start on cloudfare - env not #912
Copy link
Copy link
Open
Description
tanstack-start-cloudfare-template
followed this template above.
however when declaring env at the beginning of __root.tsx, then using it to access GT secrets, it throws error
"[vite] Internal server error: Failed to resolve import "cloudflare:workers" from "src/routes/__root.tsx". Does the file exist?"
function RootComponent() {
return (
<GTProvider
{...gtConfig}
projectId={env.GT_PROJECT_ID}
devApiKey={env.GT_API_KEY}
loadTranslations={loadTranslations}
dictionary={dictionary}
>
<RootDocument>
<Outlet />
</RootDocument>
</GTProvider>
);
}
function RootDocument({ children }: { children: React.ReactNode }) {
return (
<html>
<head>
<HeadContent />
</head>
<body className="min-h-screen p-4 font-sans antialiased bg-background md:p-8">
<Header />
<main className="flex-1">{children}</main>
<Toaster richColors />
<TanStackRouterDevtools position="bottom-right" />
<ReactQueryDevtools buttonPosition="bottom-left" />
<Scripts />
</body>
</html>
);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels