Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit 8bef1fd

Browse files
committed
fix: parse sentry sample rate with coerce
1 parent 54479f9 commit 8bef1fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/env.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const baseSchema = {
1717
const devSchema = {
1818
client: {
1919
NEXT_PUBLIC_SENTRY_DNS: z.string().optional(),
20-
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.number().optional(),
20+
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.coerce.number().optional(),
2121
},
2222
// ... other dev/test-specific properties
2323
};
@@ -26,7 +26,7 @@ const devSchema = {
2626
const stagingSchema = {
2727
client: {
2828
NEXT_PUBLIC_SENTRY_DNS: z.string().optional(),
29-
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.number().optional(),
29+
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.coerce.number().optional(),
3030
},
3131
// ... other staging-specific properties
3232
};
@@ -37,7 +37,7 @@ const productionSchema = {
3737
NEXT_PUBLIC_SENTRY_DNS: z
3838
.string()
3939
.min(1, { message: 'Sentry DNS is required in production' }),
40-
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.number(),
40+
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE: z.coerce.number(),
4141
},
4242
// ... other production-specific properties
4343
};

0 commit comments

Comments
 (0)