fix: make connectionString optional
This commit is contained in:
2
env/server.ts
vendored
2
env/server.ts
vendored
@@ -9,7 +9,7 @@ export const env = createEnv({
|
|||||||
*/
|
*/
|
||||||
isServer: typeof window === "undefined" || "Deno" in window,
|
isServer: typeof window === "undefined" || "Deno" in window,
|
||||||
server: {
|
server: {
|
||||||
APPLICATION_INSIGHTS_CONNECTION_STRING: z.string(),
|
APPLICATION_INSIGHTS_CONNECTION_STRING: z.string().optional(),
|
||||||
ADOBE_SCRIPT_SRC: z.string().optional(),
|
ADOBE_SCRIPT_SRC: z.string().optional(),
|
||||||
ADOBE_SDK_SCRIPT_SRC: z.string().optional(),
|
ADOBE_SDK_SCRIPT_SRC: z.string().optional(),
|
||||||
API_BASEURL: z.string(),
|
API_BASEURL: z.string(),
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { env } from "./env/server"
|
import { env } from "./env/server"
|
||||||
|
|
||||||
export async function register() {
|
export async function register() {
|
||||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
if (
|
||||||
|
process.env.NEXT_RUNTIME === "nodejs" &&
|
||||||
|
env.APPLICATION_INSIGHTS_CONNECTION_STRING
|
||||||
|
) {
|
||||||
const { AzureMonitorTraceExporter } = await import(
|
const { AzureMonitorTraceExporter } = await import(
|
||||||
"@azure/monitor-opentelemetry-exporter"
|
"@azure/monitor-opentelemetry-exporter"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user