fix: invalid validation of VERCEL_URL leads to build errors on Vercel (#875)

* fix: invalid validation of VERCEL_URL leads to build errors on Vercel

* fix build errors
This commit is contained in:
Matti Nannt
2023-09-30 22:07:17 +02:00
committed by GitHub
parent 13afba7615
commit 5aad6ea095
3 changed files with 10 additions and 9 deletions

View File

@@ -1,14 +1,14 @@
"use client";
import { TSurveyQuestionType } from "@formbricks/types/v1/surveys";
import QuestionsComboBox, { QuestionOption, OptionsType } from "./QuestionsComboBox";
import { useState, useEffect, useCallback } from "react";
import { Popover, PopoverTrigger, PopoverContent, Button, Checkbox } from "@formbricks/ui";
import { ChevronDown, ChevronUp, Plus } from "lucide-react";
import { TrashIcon } from "@heroicons/react/24/solid";
import QuestionFilterComboBox from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/QuestionFilterComboBox";
import { useResponseFilter } from "@/app/(app)/environments/[environmentId]/ResponseFilterContext";
import QuestionFilterComboBox from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/QuestionFilterComboBox";
import { TSurveyQuestionType } from "@formbricks/types/v1/surveys";
import { Button, Checkbox, Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui";
import { TrashIcon } from "@heroicons/react/24/solid";
import clsx from "clsx";
import { ChevronDown, ChevronUp, Plus } from "lucide-react";
import { useEffect, useState } from "react";
import QuestionsComboBox, { OptionsType, QuestionOption } from "./QuestionsComboBox";
export type QuestionFilterOptions = {
type: TSurveyQuestionType | "Attributes" | "Tags";

View File

@@ -47,7 +47,7 @@ export const env = createEnv({
GOOGLE_AUTH_ENABLED: z.enum(["1", "0"]).optional(),
INVITE_DISABLED: z.enum(["1", "0"]).optional(),
IS_FORMBRICKS_CLOUD: z.enum(["1", "0"]).optional(),
VERCEL_URL: z.string().url().optional(),
VERCEL_URL: z.string().optional(),
SURVEY_BASE_URL: z.string().optional(),
GOOGLE_SHEETS_CLIENT_ID: z.string().optional(),
GOOGLE_SHEETS_CLIENT_SECRET: z.string().optional(),

View File

@@ -7,7 +7,8 @@ export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and rev
export const MAU_LIMIT = IS_FORMBRICKS_CLOUD ? 5000 : 1000000;
// URLs
export const WEBAPP_URL = env.WEBAPP_URL || env.VERCEL_URL || "http://localhost:3000";
export const WEBAPP_URL =
env.WEBAPP_URL || (env.VERCEL_URL ? `https://${env.VERCEL_URL}` : false) || "http://localhost:3000";
export const SURVEY_BASE_URL = env.SURVEY_BASE_URL ? env.SURVEY_BASE_URL + "/" : `${WEBAPP_URL}/s/`;