File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,7 @@ import { Env } from './Env';
14
14
let client ;
15
15
let drizzle : PgDatabase < any , any , any > ;
16
16
17
- if (
18
- process . env . NEXT_PHASE !== PHASE_PRODUCTION_BUILD &&
19
- process . env . NODE_ENV === 'production' &&
20
- Env . DATABASE_URL
21
- ) {
17
+ if ( process . env . NEXT_PHASE !== PHASE_PRODUCTION_BUILD && Env . DATABASE_URL ) {
22
18
client = new Client ( {
23
19
connectionString : Env . DATABASE_URL ,
24
20
} ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ export const Env = createEnv({
13
13
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY : z . string ( ) . min ( 1 ) ,
14
14
NEXT_PUBLIC_CLERK_SIGN_IN_URL : z . string ( ) . min ( 1 ) ,
15
15
} ,
16
+ shared : {
17
+ NODE_ENV : z . enum ( [ 'development' , 'production' ] ) ,
18
+ } ,
16
19
// You need to destructure all the keys manually
17
20
runtimeEnv : {
18
21
CLERK_SECRET_KEY : process . env . CLERK_SECRET_KEY ,
@@ -22,5 +25,6 @@ export const Env = createEnv({
22
25
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY :
23
26
process . env . NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY ,
24
27
NEXT_PUBLIC_CLERK_SIGN_IN_URL : process . env . NEXT_PUBLIC_CLERK_SIGN_IN_URL ,
28
+ NODE_ENV : process . env . NODE_ENV ,
25
29
} ,
26
30
} ) ;
You can’t perform that action at this time.
0 commit comments