You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 2 `process.env` should only be used in server files
24
24
25
25
```ts
26
-
process.env.VITE_SECRET
26
+
// Warning in client file
27
+
const apiUrl =process.env.API_URL;
28
+
29
+
// No warning in server file
30
+
exportasyncfunction load() {
31
+
const secret =process.env.DATABASE_PASSWORD;
32
+
}
27
33
```
28
34
29
35
Warning:
30
36
31
37
`process.env should only be used in server files`
32
38
39
+
**Note:**`process.env` is allowed in configuration files like `svelte.config.js` or `svelte.config.ts`, as these are Node.js files that run during build time.
40
+
33
41
## 3 `$env/dynamic/private` cannot be used in client-side code
0 commit comments