-
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