-
Notifications
You must be signed in to change notification settings - Fork 414
Open
Labels
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
Loving the look of V2! I've noticed that when starting a project in dev mode with vite dev, none of the Private Environment Variables (those not prepended with VITE_) are available to Server Functions
.env
MY_SECRET=hello
routes/index.tsx
import { createAsync } from "@solidjs/router";
const myServerFn = async () => {
"use server";
if (typeof process.env.MY_SECRET === "undefined") {
return "MY_SECRET is undefined";
}
return "OK";
};
export default function Component() {
const result = createAsync(myServerFn);
return (
<>{result()}</> //Shows "MY_SECRET is undefined"
);
}
The documentation on Private Environment Variables suggests that this should be OK.
Expected behavior 🤔
process.envshould be available in dev mode
Steps to reproduce 🕹
Steps:
Context 🔦
No response
Your environment 🌎
Reactions are currently unavailable