T3 Env: Unconventional Setup: SvelteKit + Payload CMS
Turborepo
Frontend running
SvelteKit file that reaches outside of its project folder to get
My
How do I get
Do I need it in frontend (SvelteKit) as well? Just tried this, didn't work...
- Frontend: SvelteKit - Node Adapter > build artifact in backend folder
- Backend: Payload CMS v3 - Next.js Custom Express Server ->
/adminroute handled by Next.js, all other routes handled byhandler.jsbuild artifact by SvelteKit.
.env on its root.Frontend running
dev- Importing my
payload.config.tsfrom backend to SvelteKit to make local API calls givesRequiredissue on all ENV variables. Meaning it isn't detecting any ENV variables.
.env file in root of SvelteKit. console.log() env variables and they show up. SvelteKit file that reaches outside of its project folder to get
payload.config.ts from backend. The payload.config.ts references the env.MY_VARIABLEMy
createEnv is at backend/src/env.tsHow do I get
@t3-oss/env-core to find env files like this? @t3-oss/env-core is only installed on backend.Do I need it in frontend (SvelteKit) as well? Just tried this, didn't work...