grant
12/08/2021, 12:53 AMErwin
12/08/2021, 12:54 AMgrant
12/08/2021, 12:55 AM_worker.js
). I may be misunderstanding what the adapter is doing, but it's working as expected in my testing. I just can't quite make the connection to get the namespaces/env variables available in themErwin
12/08/2021, 12:58 AMgrant
12/08/2021, 12:58 AMgrant
12/08/2021, 12:59 AMts
import type { EndpointOutput } from "@sveltejs/kit"
export async function get(): Promise<EndpointOutput> {
const res: Response = await fetch('https://jsonplaceholder.typicode.com/users/1')
const user = await res.json()
return {
body: user
}
}
grant
12/08/2021, 1:00 AMgrant
12/08/2021, 1:01 AMVITE_
prefixes, but not having a ton of luckgrant
12/08/2021, 1:04 AM.env
file + VITE_
prefix locally. Going to test deployment to see what it looks likeErwin
12/08/2021, 1:07 AMGreg Brimble | Cloudflare Pages
12/08/2021, 1:11 AMenv
object (which contains your env vars and namespaces) is being passed to the renderer.Greg Brimble | Cloudflare Pages
12/08/2021, 1:11 AMErwin
12/08/2021, 1:12 AMGreg Brimble | Cloudflare Pages
12/08/2021, 1:13 AMgrant
12/08/2021, 1:13 AMenv
is getting pushed along, which may be the missing piece?Greg Brimble | Cloudflare Pages
12/08/2021, 1:15 AMGreg Brimble | Cloudflare Pages
12/08/2021, 1:15 AMgrant
12/08/2021, 1:16 AMIncomingRequest
in these lines - https://github.com/sveltejs/kit/blob/master/packages/adapter-cloudflare/files/worker.js#L15-L22grant
12/08/2021, 1:17 AMenv
for the worker, but it doesn't pass it along or make it available anywhereGreg Brimble | Cloudflare Pages
12/08/2021, 1:17 AMgrant
12/08/2021, 1:18 AMVITE_
prefix and it does work using [this workaround](https://dev.to/danawoodman/storing-environment-variables-in-sveltekit-2of3)grant
12/08/2021, 1:19 AMVITE_
... worth a shot to try I guessgrant
12/08/2021, 1:20 AMgrant
12/08/2021, 1:24 AMIncomingRequest
interface to add env
... and maybe even context
? Thoughts?grant
12/08/2021, 1:24 AMGreg Brimble | Cloudflare Pages
12/08/2021, 1:31 AMAmenadiel
12/08/2021, 2:36 AMstonys
12/08/2021, 10:51 AMchrisjmccreadie
12/08/2021, 10:57 AM